peer-cfg: Use struct to pass data to constructor

This commit is contained in:
Tobias Brunner
2016-04-09 16:51:01 +02:00
committed by Andreas Steffen
parent 8a00a8452d
commit 2ba5dadb12
16 changed files with 266 additions and 200 deletions
@@ -673,6 +673,13 @@ static job_requeue_t initiate(private_android_service_t *this)
traffic_selector_t *ts;
ike_sa_t *ike_sa;
auth_cfg_t *auth;
peer_cfg_create_t peer = {
.cert_policy = CERT_SEND_IF_ASKED,
.unique = UNIQUE_REPLACE,
.rekey_time = 36000, /* 10h */
.jitter_time = 600, /* 10min */
.over_time = 600, /* 10min */
};
child_cfg_create_t child = {
.lifetime = {
.time = {
@@ -697,13 +704,7 @@ static job_requeue_t initiate(private_android_service_t *this)
ike_cfg->add_proposal(ike_cfg, proposal_create_default(PROTO_IKE));
ike_cfg->add_proposal(ike_cfg, proposal_create_default_aead(PROTO_IKE));
peer_cfg = peer_cfg_create("android", ike_cfg, CERT_SEND_IF_ASKED,
UNIQUE_REPLACE, 0, /* keyingtries */
36000, 0, /* rekey 10h, reauth none */
600, 600, /* jitter, over 10min */
TRUE, FALSE, TRUE, /* mobike, aggressive, pull */
0, 0, /* DPD delay, timeout */
FALSE, NULL, NULL); /* mediation */
peer_cfg = peer_cfg_create("android", ike_cfg, &peer);
peer_cfg->add_virtual_ip(peer_cfg, host_create_any(AF_INET));
peer_cfg->add_virtual_ip(peer_cfg, host_create_any(AF_INET6));