vici list-conns sends reauthentication and rekeying time information

This commit is contained in:
Andreas Steffen
2016-05-04 18:13:52 +02:00
parent e88f21cf65
commit b1df631212
9 changed files with 114 additions and 23 deletions
+5 -1
View File
@@ -428,10 +428,14 @@ static uint64_t apply_jitter(uint64_t rekey, uint64_t jitter)
#define APPLY_JITTER(l) l.rekey = apply_jitter(l.rekey, l.jitter)
METHOD(child_cfg_t, get_lifetime, lifetime_cfg_t*,
private_child_cfg_t *this)
private_child_cfg_t *this, bool jitter)
{
lifetime_cfg_t *lft = malloc_thing(lifetime_cfg_t);
memcpy(lft, &this->lifetime, sizeof(lifetime_cfg_t));
if (!jitter)
{
lft->time.jitter = lft->bytes.jitter = lft->packets.jitter = 0;
}
APPLY_JITTER(lft->time);
APPLY_JITTER(lft->bytes);
APPLY_JITTER(lft->packets);
+2 -1
View File
@@ -157,9 +157,10 @@ struct child_cfg_t {
* The rekey limits automatically contain a jitter to avoid simultaneous
* rekeying. These values will change with each call to this function.
*
* @param jitter subtract jitter value to randomize lifetimes
* @return lifetime_cfg_t (has to be freed)
*/
lifetime_cfg_t* (*get_lifetime) (child_cfg_t *this);
lifetime_cfg_t* (*get_lifetime) (child_cfg_t *this, bool jitter);
/**
* Get the mode to use for the CHILD_SA.
+2 -2
View File
@@ -228,7 +228,7 @@ struct peer_cfg_t {
/**
* Get a time to start rekeying.
*
* @param jitter remove a jitter value to randomize time
* @param jitter subtract a jitter value to randomize time
* @return time in s when to start rekeying, 0 disables rekeying
*/
uint32_t (*get_rekey_time)(peer_cfg_t *this, bool jitter);
@@ -236,7 +236,7 @@ struct peer_cfg_t {
/**
* Get a time to start reauthentication.
*
* @param jitter remove a jitter value to randomize time
* @param jitter subtract a jitter value to randomize time
* @return time in s when to start reauthentication, 0 disables it
*/
uint32_t (*get_reauth_time)(peer_cfg_t *this, bool jitter);