From 13e4a62f5c352981a93156be7749bfa712782d84 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Tue, 25 Apr 2006 10:06:30 +0000 Subject: - added separate implementation for connection_store, credential_store, policy_store - added folder structure to config - credentials are fetched solely on IDs now --- Source/charon/daemon.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'Source/charon/daemon.c') diff --git a/Source/charon/daemon.c b/Source/charon/daemon.c index 376a09979..680519228 100644 --- a/Source/charon/daemon.c +++ b/Source/charon/daemon.c @@ -32,6 +32,9 @@ #include "daemon.h" #include +#include +#include +#include typedef struct private_daemon_t private_daemon_t; @@ -162,17 +165,25 @@ static void kill_daemon(private_daemon_t *this, char *reason) */ static void initialize(private_daemon_t *this) { + local_credential_store_t* cred_store; + this->public.configuration = configuration_create(); this->public.socket = socket_create(IKEV2_UDP_PORT); this->public.ike_sa_manager = ike_sa_manager_create(); this->public.job_queue = job_queue_create(); this->public.event_queue = event_queue_create(); this->public.send_queue = send_queue_create(); - this->public.stroke = stroke_create(); - this->public.connections = &this->public.stroke->connections; - this->public.policies = &this->public.stroke->policies; - this->public.credentials = &this->public.stroke->credentials; + this->public.connections = (connection_store_t*)local_connection_store_create(); + this->public.policies = (policy_store_t*)local_policy_store_create(); + this->public.credentials = (credential_store_t*)(cred_store = local_credential_store_create()); + + /* load keys & certs */ + cred_store->load_certificates(cred_store, CERTIFICATE_DIR); + cred_store->load_private_keys(cred_store, PRIVATE_KEY_DIR); + + /* start building threads, we are multi-threaded NOW */ + this->public.stroke = stroke_create(); this->public.sender = sender_create(); this->public.receiver = receiver_create(); this->public.scheduler = scheduler_create(); -- cgit v1.2.3