- changed config load strategy:

starter loads both connections in charon & pluto,
  charon ignores anything with keyexchange!=ikev2.
  pluto needs the same behavior.
This commit is contained in:
Martin Willi
2006-05-23 10:07:02 +00:00
parent de1584de40
commit 7ba69503aa
7 changed files with 69 additions and 57 deletions
+18 -2
View File
@@ -55,6 +55,11 @@ struct private_connection_t {
*/
char *name;
/**
* Does charon handle this connection? Or can he ignore it?
*/
bool ikev2;
/**
* ID of us
*/
@@ -94,6 +99,14 @@ static char *get_name (private_connection_t *this)
return this->name;
}
/**
* Implementation of connection_t.is_ikev2.
*/
static bool is_ikev2 (private_connection_t *this)
{
return this->ikev2;
}
/**
* Implementation of connection_t.get_my_id.
*/
@@ -287,6 +300,7 @@ static connection_t *clone(private_connection_t *this)
proposal_t *proposal;
private_connection_t *clone = (private_connection_t*)connection_create(
this->name,
this->ikev2,
this->my_host->clone(this->my_host),
this->other_host->clone(this->other_host),
this->my_id->clone(this->my_id),
@@ -309,7 +323,7 @@ static connection_t *clone(private_connection_t *this)
/**
* Implementation of connection_t.destroy.
*/
static void destroy (private_connection_t *this)
static void destroy(private_connection_t *this)
{
proposal_t *proposal;
@@ -330,12 +344,13 @@ static void destroy (private_connection_t *this)
/**
* Described in header.
*/
connection_t * connection_create(char *name, host_t *my_host, host_t *other_host, identification_t *my_id, identification_t *other_id, auth_method_t auth_method)
connection_t * connection_create(char *name, bool ikev2, host_t *my_host, host_t *other_host, identification_t *my_id, identification_t *other_id, auth_method_t auth_method)
{
private_connection_t *this = malloc_thing(private_connection_t);
/* public functions */
this->public.get_name = (char*(*)(connection_t*))get_name;
this->public.is_ikev2 = (bool(*)(connection_t*))is_ikev2;
this->public.get_my_id = (identification_t*(*)(connection_t*))get_my_id;
this->public.get_other_id = (identification_t*(*)(connection_t*))get_other_id;
this->public.get_my_host = (host_t*(*)(connection_t*))get_my_host;
@@ -355,6 +370,7 @@ connection_t * connection_create(char *name, host_t *my_host, host_t *other_host
/* private variables */
this->name = strdup(name);
this->ikev2 = ikev2;
this->my_host = my_host;
this->other_host = other_host;
this->my_id = my_id;
+15 -1
View File
@@ -222,6 +222,18 @@ struct connection_t {
*/
char* (*get_name) (connection_t *this);
/**
* @brief Check if the connection is marked as an IKEv2 connection.
*
* Since all connections (IKEv1+2) are loaded, but charon handles
* only those marked with IKEv2, this flag can tell us if we must
* ignore a connection on initiaton. Then pluto will do it for us.
*
* @param this calling object
* @return - TRUE, if this is an IKEv2 connection
*/
bool (*is_ikev2) (connection_t *this);
/**
* @brief Get the DH group to use for connection initialization.
*
@@ -265,6 +277,7 @@ struct connection_t {
* connection_create(). Name gets cloned internally.
*
* @param name connection identifier
* @param ikev2 TRUE if this is an IKEv2 connection
* @param my_host host_t representing local address
* @param other_host host_t representing remote address
* @param my_id identification_t for me
@@ -274,7 +287,8 @@ struct connection_t {
*
* @ingroup config
*/
connection_t * connection_create(char *name,
connection_t * connection_create(char *name,
bool ikev2,
host_t *my_host, host_t *other_host,
identification_t *my_id,
identification_t *other_id,