diff options
Diffstat (limited to 'src/charon/config')
-rw-r--r-- | src/charon/config/child_cfg.c | 18 | ||||
-rw-r--r-- | src/charon/config/child_cfg.h | 11 |
2 files changed, 27 insertions, 2 deletions
diff --git a/src/charon/config/child_cfg.c b/src/charon/config/child_cfg.c index 350a5a99e..8410b3fe5 100644 --- a/src/charon/config/child_cfg.c +++ b/src/charon/config/child_cfg.c @@ -107,6 +107,11 @@ struct private_child_cfg_t { bool use_ipcomp; /** + * Inactivity timeout + */ + u_int32_t inactivity; + + /** * set up IPsec transport SA in MIPv6 proxy mode */ bool proxy_mode; @@ -433,6 +438,14 @@ static bool use_ipcomp(private_child_cfg_t *this) } /** + * Implementation of child_cfg_t.get_inactivity. + */ +static u_int32_t get_inactivity(private_child_cfg_t *this) +{ + return this->inactivity; +} + +/** * Implementation of child_cfg_t.set_mipv6_options. */ static void set_mipv6_options(private_child_cfg_t *this, bool proxy_mode, @@ -492,7 +505,8 @@ static void destroy(private_child_cfg_t *this) child_cfg_t *child_cfg_create(char *name, lifetime_cfg_t *lifetime, char *updown, bool hostaccess, ipsec_mode_t mode, action_t dpd_action, - action_t close_action, bool ipcomp) + action_t close_action, bool ipcomp, + u_int32_t inactivity) { private_child_cfg_t *this = malloc_thing(private_child_cfg_t); @@ -511,6 +525,7 @@ child_cfg_t *child_cfg_create(char *name, lifetime_cfg_t *lifetime, this->public.get_dh_group = (diffie_hellman_group_t(*)(child_cfg_t*)) get_dh_group; this->public.set_mipv6_options = (void (*) (child_cfg_t*,bool,bool))set_mipv6_options; this->public.use_ipcomp = (bool (*) (child_cfg_t *))use_ipcomp; + this->public.get_inactivity = (u_int32_t (*) (child_cfg_t *))get_inactivity; this->public.use_proxy_mode = (bool (*) (child_cfg_t *))use_proxy_mode; this->public.install_policy = (bool (*) (child_cfg_t *))install_policy; this->public.get_ref = (child_cfg_t* (*) (child_cfg_t*))get_ref; @@ -523,6 +538,7 @@ child_cfg_t *child_cfg_create(char *name, lifetime_cfg_t *lifetime, this->dpd_action = dpd_action; this->close_action = close_action; this->use_ipcomp = ipcomp; + this->inactivity = inactivity; this->proxy_mode = FALSE; this->install_policy = TRUE; this->refcount = 1; diff --git a/src/charon/config/child_cfg.h b/src/charon/config/child_cfg.h index f98170d69..c6186ea36 100644 --- a/src/charon/config/child_cfg.h +++ b/src/charon/config/child_cfg.h @@ -232,6 +232,13 @@ struct child_cfg_t { bool (*use_ipcomp)(child_cfg_t *this); /** + * Get the inactivity timeout value. + * + * @return inactivity timeout in s + */ + u_int32_t (*get_inactivity)(child_cfg_t *this); + + /** * Sets two options needed for Mobile IPv6 interoperability * * @param proxy_mode use IPsec transport proxy mode (default FALSE) @@ -291,11 +298,13 @@ struct child_cfg_t { * @param dpd_action DPD action * @param close_action close action * @param ipcomp use IPComp, if peer supports it + * @param inactivity inactivity timeout in s before closing a CHILD_SA * @return child_cfg_t object */ child_cfg_t *child_cfg_create(char *name, lifetime_cfg_t *lifetime, char *updown, bool hostaccess, ipsec_mode_t mode, action_t dpd_action, - action_t close_action, bool ipcomp); + action_t close_action, bool ipcomp, + u_int32_t inactivity); #endif /** CHILD_CFG_H_ @}*/ |