/*
* Copyright (C) 2008 Martin Willi
- * Hochschule fuer Technik Rapperswil
+ * HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
auth_cfg_t *auth;
ike_cfg_t *ike_cfg;
peer_cfg_t *med_cfg;
+ ike_cfg_create_t ike = {
+ .version = IKEV2,
+ .local = "0.0.0.0",
+ .local_port = charon->socket->get_port(charon->socket, FALSE),
+ .remote_port = IKEV2_UDP_PORT,
+ .no_certreq = TRUE,
+ };
peer_cfg_create_t peer = *defaults;
chunk_t me, other;
- char *address;
/* query mediation server config:
* - build ike_cfg/peer_cfg for mediation connection on-the-fly
"SELECT Address, ClientConfig.KeyId, MediationServerConfig.KeyId "
"FROM MediationServerConfig JOIN ClientConfig",
DB_TEXT, DB_BLOB, DB_BLOB);
- if (!e || !e->enumerate(e, &address, &me, &other))
+ if (!e || !e->enumerate(e, &ike.remote, &me, &other))
{
DESTROY_IF(e);
return NULL;
}
- ike_cfg = ike_cfg_create(IKEV2, FALSE, FALSE, "0.0.0.0",
- charon->socket->get_port(charon->socket, FALSE),
- address, IKEV2_UDP_PORT, FRAGMENTATION_NO, 0);
+ ike_cfg = ike_cfg_create(&ike);
ike_cfg->add_proposal(ike_cfg, proposal_create_default(PROTO_IKE));
ike_cfg->add_proposal(ike_cfg, proposal_create_default_aead(PROTO_IKE));
medcli_config_t *medcli_config_create(database_t *db)
{
private_medcli_config_t *this;
+ ike_cfg_create_t ike = {
+ .version = IKEV2,
+ .local = "0.0.0.0",
+ .local_port = charon->socket->get_port(charon->socket, FALSE),
+ .remote = "0.0.0.0",
+ .remote_port = IKEV2_UDP_PORT,
+ .no_certreq = TRUE,
+ };
INIT(this,
.public = {
.db = db,
.rekey = lib->settings->get_time(lib->settings, "medcli.rekey", 1200),
.dpd = lib->settings->get_time(lib->settings, "medcli.dpd", 300),
- .ike = ike_cfg_create(IKEV2, FALSE, FALSE, "0.0.0.0",
- charon->socket->get_port(charon->socket, FALSE),
- "0.0.0.0", IKEV2_UDP_PORT,
- FRAGMENTATION_NO, 0),
+ .ike = ike_cfg_create(&ike),
);
this->ike->add_proposal(this->ike, proposal_create_default(PROTO_IKE));
this->ike->add_proposal(this->ike, proposal_create_default_aead(PROTO_IKE));