aboutsummaryrefslogtreecommitdiffstats
path: root/Source/charon/sa
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2005-11-29 10:25:07 +0000
committerMartin Willi <martin@strongswan.org>2005-11-29 10:25:07 +0000
commit0e96f7d8c3aefaa1717f4c30e66fdc459d3f2ecc (patch)
tree9482ca76a46e005757ac485007ad18c8fa38d794 /Source/charon/sa
parent79b9c1d6c5ebf296d29e11f4a5f25c0bf60f896c (diff)
downloadstrongswan-0e96f7d8c3aefaa1717f4c30e66fdc459d3f2ecc.tar.bz2
strongswan-0e96f7d8c3aefaa1717f4c30e66fdc459d3f2ecc.tar.xz
- globals packed in a daemon
Diffstat (limited to 'Source/charon/sa')
-rw-r--r--Source/charon/sa/ike_sa.c10
-rw-r--r--Source/charon/sa/ike_sa_manager.c6
-rw-r--r--Source/charon/sa/states/ike_sa_init_requested.c4
-rw-r--r--Source/charon/sa/states/initiator_init.c13
-rw-r--r--Source/charon/sa/states/responder_init.c8
5 files changed, 21 insertions, 20 deletions
diff --git a/Source/charon/sa/ike_sa.c b/Source/charon/sa/ike_sa.c
index 91ab32390..7d6fcef20 100644
--- a/Source/charon/sa/ike_sa.c
+++ b/Source/charon/sa/ike_sa.c
@@ -23,7 +23,7 @@
#include "ike_sa.h"
#include <types.h>
-#include <globals.h>
+#include <daemon.h>
#include <definitions.h>
#include <utils/allocator.h>
#include <utils/linked_list.h>
@@ -414,7 +414,7 @@ static status_t resend_last_reply(private_ike_sa_t *this)
return status;
}
- global_send_queue->add(global_send_queue, packet);
+ charon->send_queue->add(charon->send_queue, packet);
return SUCCESS;
}
@@ -428,7 +428,7 @@ static status_t create_delete_job(private_ike_sa_t *this)
this->logger->log(this->logger, CONTROL | MORE, "Going to create job to delete this IKE_SA");
delete_job = (job_t *) delete_ike_sa_job_create(this->ike_sa_id);
- global_job_queue->add(global_job_queue,delete_job);
+ charon->job_queue->add(charon->job_queue,delete_job);
return SUCCESS;
}
@@ -738,7 +738,7 @@ static void destroy (private_ike_sa_t *this)
this->current_state->destroy(this->current_state);
this->logger->log(this->logger, CONTROL | MOST, "Destroy logger of IKE_SA");
- global_logger_manager->destroy_logger(global_logger_manager, this->logger);
+ charon->logger_manager->destroy_logger(charon->logger_manager, this->logger);
allocator_free(this);
}
@@ -776,7 +776,7 @@ ike_sa_t * ike_sa_create(ike_sa_id_t *ike_sa_id)
/* initialize private fields */
- this->logger = global_logger_manager->create_logger(global_logger_manager, IKE_SA, NULL);
+ this->logger = charon->logger_manager->create_logger(charon->logger_manager, IKE_SA, NULL);
this->ike_sa_id = ike_sa_id->clone(ike_sa_id);
this->child_sas = linked_list_create();
diff --git a/Source/charon/sa/ike_sa_manager.c b/Source/charon/sa/ike_sa_manager.c
index 34b2a09b3..49b817642 100644
--- a/Source/charon/sa/ike_sa_manager.c
+++ b/Source/charon/sa/ike_sa_manager.c
@@ -25,7 +25,7 @@
#include "ike_sa_manager.h"
-#include <globals.h>
+#include <daemon.h>
#include <sa/ike_sa_id.h>
#include <utils/allocator.h>
#include <utils/logger.h>
@@ -645,7 +645,7 @@ static void destroy(private_ike_sa_manager_t *this)
pthread_mutex_unlock(&(this->mutex));
/* destroy logger at end */
- global_logger_manager->destroy_logger(global_logger_manager,this->logger);
+ charon->logger_manager->destroy_logger(charon->logger_manager,this->logger);
allocator_free(this);
}
@@ -672,7 +672,7 @@ ike_sa_manager_t *ike_sa_manager_create()
this->delete_entry = delete_entry;
/* initialize private variables */
- this->logger = global_logger_manager->create_logger(global_logger_manager,IKE_SA_MANAGER,NULL);
+ this->logger = charon->logger_manager->create_logger(charon->logger_manager,IKE_SA_MANAGER,NULL);
this->ike_sa_list = linked_list_create();
diff --git a/Source/charon/sa/states/ike_sa_init_requested.c b/Source/charon/sa/states/ike_sa_init_requested.c
index d5ad12cf4..c039e733a 100644
--- a/Source/charon/sa/states/ike_sa_init_requested.c
+++ b/Source/charon/sa/states/ike_sa_init_requested.c
@@ -22,7 +22,7 @@
#include "ike_sa_init_requested.h"
-#include <globals.h>
+#include <daemon.h>
#include <utils/allocator.h>
#include <encoding/payloads/sa_payload.h>
#include <encoding/payloads/ke_payload.h>
@@ -143,7 +143,7 @@ static status_t process_message(private_ike_sa_init_requested_t *this, message_t
/* now let the configuration-manager check the selected proposals*/
this->logger->log(this->logger, CONTROL | MOST, "Check suggested proposals");
- status = global_configuration_manager->check_selected_proposals_for_host(global_configuration_manager,
+ status = charon->configuration_manager->check_selected_proposals_for_host(charon->configuration_manager,
this->ike_sa->get_other_host(this->ike_sa), suggested_proposals,&valid);
if (status != SUCCESS)
{
diff --git a/Source/charon/sa/states/initiator_init.c b/Source/charon/sa/states/initiator_init.c
index ade422fb1..7ade885d4 100644
--- a/Source/charon/sa/states/initiator_init.c
+++ b/Source/charon/sa/states/initiator_init.c
@@ -23,7 +23,7 @@
#include "initiator_init.h"
-#include <globals.h>
+#include <daemon.h>
#include <sa/states/state.h>
#include <sa/states/ike_sa_init_requested.h>
#include <utils/allocator.h>
@@ -148,7 +148,7 @@ static status_t initiate_connection (private_initiator_init_t *this, char *name)
this->logger->log(this->logger, CONTROL, "Initializing connection %s",name);
/* get local host */
- status = global_configuration_manager->get_local_host(global_configuration_manager, name, &my_host);
+ status = charon->configuration_manager->get_local_host(charon->configuration_manager, name, &my_host);
if (status != SUCCESS)
{
this->logger->log(this->logger, ERROR | MORE, "Could not retrieve local host configuration information for %s",name);
@@ -157,7 +157,7 @@ static status_t initiate_connection (private_initiator_init_t *this, char *name)
this->ike_sa->set_my_host(this->ike_sa,my_host);
/* get remote host */
- status = global_configuration_manager->get_remote_host(global_configuration_manager, name, &other_host);
+ status = charon->configuration_manager->get_remote_host(charon->configuration_manager, name, &other_host);
if (status != SUCCESS)
{
this->logger->log(this->logger, ERROR | MORE, "Could not retrieve remote host configuration information for %s",name);
@@ -166,7 +166,7 @@ static status_t initiate_connection (private_initiator_init_t *this, char *name)
this->ike_sa->set_other_host(this->ike_sa,other_host);
/* get dh group */
- status = global_configuration_manager->get_dh_group_number(global_configuration_manager, name, &(this->dh_group_number), this->dh_group_priority);
+ status = charon->configuration_manager->get_dh_group_number(charon->configuration_manager, name, &(this->dh_group_number), this->dh_group_priority);
if (status != SUCCESS)
{
this->logger->log(this->logger, ERROR | MORE, "Could not retrieve DH group number configuration for %s",name);
@@ -175,7 +175,8 @@ static status_t initiate_connection (private_initiator_init_t *this, char *name)
/* get proposals */
proposal_iterator = this->proposals->create_iterator(this->proposals, FALSE);
- status = global_configuration_manager->get_proposals_for_host(global_configuration_manager, this->ike_sa->get_other_host(this->ike_sa), proposal_iterator);
+ status = charon->configuration_manager->get_proposals_for_host(charon->configuration_manager, this->ike_sa->get_other_host(this->ike_sa), proposal_iterator);
+
proposal_iterator->destroy(proposal_iterator);
if (status != SUCCESS)
{
@@ -220,7 +221,7 @@ static status_t initiate_connection (private_initiator_init_t *this, char *name)
}
this->logger->log(this->logger, CONTROL|MOST, "Add packet to global send queue");
- global_send_queue->add(global_send_queue, packet);
+ charon->send_queue->add(charon->send_queue, packet);
/* state can now be changed */
this->logger->log(this->logger, CONTROL|MOST, "Create next state object");
diff --git a/Source/charon/sa/states/responder_init.c b/Source/charon/sa/states/responder_init.c
index b528be0e2..ae906fc39 100644
--- a/Source/charon/sa/states/responder_init.c
+++ b/Source/charon/sa/states/responder_init.c
@@ -22,7 +22,7 @@
#include "responder_init.h"
-#include <globals.h>
+#include <daemon.h>
#include <sa/states/state.h>
#include <sa/states/ike_sa_init_responded.h>
#include <utils/allocator.h>
@@ -204,7 +204,7 @@ static status_t process_message(private_responder_init_t *this, message_t *messa
suggested_proposals = sa_payload->create_proposal_substructure_iterator(sa_payload, TRUE);
/* now let the configuration-manager select a subset of the proposals */
- status = global_configuration_manager->select_proposals_for_host(global_configuration_manager,
+ status = charon->configuration_manager->select_proposals_for_host(charon->configuration_manager,
this->ike_sa->get_other_host(this->ike_sa), suggested_proposals, accepted_proposals);
if (status != SUCCESS)
{
@@ -253,7 +253,7 @@ static status_t process_message(private_responder_init_t *this, message_t *messa
group = ke_payload->get_dh_group_number(ke_payload);
- status = global_configuration_manager->is_dh_group_allowed_for_host(global_configuration_manager,
+ status = charon->configuration_manager->is_dh_group_allowed_for_host(charon->configuration_manager,
this->ike_sa->get_other_host(this->ike_sa), group, &allowed_group);
if (status != SUCCESS)
@@ -353,7 +353,7 @@ static status_t process_message(private_responder_init_t *this, message_t *messa
}
this->logger->log(this->logger, CONTROL|MOST, "Add packet to global send queue");
- global_send_queue->add(global_send_queue, packet);
+ charon->send_queue->add(charon->send_queue, packet);
/* state can now be changed */
this->logger->log(this->logger, CONTROL|MOST, "Create next state object");