diff options
author | Tobias Brunner <tobias@strongswan.org> | 2009-08-27 18:10:39 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2009-09-01 12:53:44 +0200 |
commit | abff49a7ffd0b4941ec302e587b2701327f32864 (patch) | |
tree | 646ede3c56f99b173f65e7e936a3a5c458c9baa7 /src/charon/config/child_cfg.h | |
parent | ca41aa0602ed92a6f3e0e38688424322c2312dbf (diff) | |
download | strongswan-abff49a7ffd0b4941ec302e587b2701327f32864.tar.bz2 strongswan-abff49a7ffd0b4941ec302e587b2701327f32864.tar.xz |
Handling of new lifetime limits added to stroke.
Diffstat (limited to 'src/charon/config/child_cfg.h')
-rw-r--r-- | src/charon/config/child_cfg.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/charon/config/child_cfg.h b/src/charon/config/child_cfg.h index 7bae8d9a6..ce6a23629 100644 --- a/src/charon/config/child_cfg.h +++ b/src/charon/config/child_cfg.h @@ -93,6 +93,16 @@ struct lifetime_cfg_t { }; /** + * Helper macro to easily set all three values of a specified limit (time, + * bytes, packets). + */ +#define LIFETIME_CFG_SET(l, limit, life, rekey, jitter) do { \ + (l)->life_##limit = (life); \ + (l)->rekey_##limit = (rekey); \ + (l)->jitter_##limit = (jitter); \ +} while(0) + +/** * Create a new lifetime_cfg_t object. */ static inline lifetime_cfg_t* lifetime_cfg_create() { @@ -108,9 +118,7 @@ static inline lifetime_cfg_t* lifetime_cfg_create_time(u_int64_t life, u_int64_t rekey, u_int64_t jitter) { lifetime_cfg_t *this = lifetime_cfg_create(); - this->life_time = life; - this->rekey_time = rekey; - this->jitter_time = jitter; + LIFETIME_CFG_SET(this, time, life, rekey, jitter); return this; } |