diff options
author | Tobias Brunner <tobias@strongswan.org> | 2009-08-28 17:04:35 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2009-09-01 12:54:33 +0200 |
commit | e75f4237536a84938ac1b33f143d63512710ff29 (patch) | |
tree | 5745c3ca28ebaced87c1b56dff1194815b64266a /src/charon/plugins/uci | |
parent | abff49a7ffd0b4941ec302e587b2701327f32864 (diff) | |
download | strongswan-e75f4237536a84938ac1b33f143d63512710ff29.tar.bz2 strongswan-e75f4237536a84938ac1b33f143d63512710ff29.tar.xz |
Refactored the lifetime_cfg_t struct to be simpler and more expressive. Initialization is now static.
Diffstat (limited to 'src/charon/plugins/uci')
-rw-r--r-- | src/charon/plugins/uci/uci_config.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/charon/plugins/uci/uci_config.c b/src/charon/plugins/uci/uci_config.c index 5c03acbd8..e2b0b294d 100644 --- a/src/charon/plugins/uci/uci_config.c +++ b/src/charon/plugins/uci/uci_config.c @@ -142,9 +142,15 @@ static bool peer_enumerator_enumerate(peer_enumerator_t *this, peer_cfg_t **cfg) char *local_id, *local_addr, *local_net; char *remote_id, *remote_addr, *remote_net; child_cfg_t *child_cfg; - lifetime_cfg_t *lifetime; ike_cfg_t *ike_cfg; auth_cfg_t *auth; + lifetime_cfg_t lifetime = { + .time = { + .life = create_rekey(esp_rekey) + 300, + .rekey = create_rekey(esp_rekey) + .jitter = 300 + } + }; /* defaults */ name = "unnamed"; @@ -187,9 +193,8 @@ static bool peer_enumerator_enumerate(peer_enumerator_t *this, peer_cfg_t **cfg) identification_create_from_string(remote_id)); } this->peer_cfg->add_auth_cfg(this->peer_cfg, auth, FALSE); - lifetime = lifetime_cfg_create_time(create_rekey(esp_rekey) + 300, - create_rekey(esp_rekey), 300); - child_cfg = child_cfg_create(name, lifetime, NULL, TRUE, MODE_TUNNEL, + + child_cfg = child_cfg_create(name, &lifetime, NULL, TRUE, MODE_TUNNEL, ACTION_NONE, ACTION_NONE, FALSE); child_cfg->add_proposal(child_cfg, create_proposal(esp_proposal, PROTO_ESP)); child_cfg->add_traffic_selector(child_cfg, TRUE, create_ts(local_net)); |