ikev2: Add possibility to delay initiation of a queued task

Such a task is not initiated unless a certain time has passed.  This
allows delaying certain tasks but avoids problems if we'd do this
via a scheduled job (e.g. if the IKE_SA is rekeyed in the meantime).

If the IKE_SA is rekeyed the delay of such tasks is reset when the
tasks are adopted i.e. they get executed immediately on the new IKE_SA.

This hasn't been implemented for IKEv1 yet.
This commit is contained in:
Tobias Brunner
2016-06-17 18:48:07 +02:00
parent 4e2e7d4fec
commit 208678e6e1
5 changed files with 189 additions and 66 deletions
+13 -2
View File
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2013-2016 Tobias Brunner
* Copyright (C) 2006 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
@@ -122,7 +123,17 @@ struct task_manager_t {
*
* @param task task to queue
*/
void (*queue_task) (task_manager_t *this, task_t *task);
void (*queue_task)(task_manager_t *this, task_t *task);
/**
* Queue a task in the manager, but delay its initiation for at least the
* given number of seconds.
*
* @param task task to queue
* @param delay minimum delay in s before initiating the task
*/
void (*queue_task_delayed)(task_manager_t *this, task_t *task,
uint32_t delay);
/**
* Queue IKE_SA establishing tasks.