- added global_configuration_manager

This commit is contained in:
Martin Willi
2005-11-17 11:24:03 +00:00
parent 79d5c541b5
commit ede7caad81
2 changed files with 21 additions and 0 deletions
+19
View File
@@ -63,6 +63,8 @@ socket_t *global_socket = NULL;
logger_manager_t *global_logger_manager = NULL;
/** Global ike_sa-manager */
ike_sa_manager_t *global_ike_sa_manager = NULL;
/** Global configuration-manager */
configuration_manager_t *global_configuration_manager = NULL;
/**
* logger_t object assigned for daemon things
@@ -137,6 +139,16 @@ int main()
logger->log(logger,CONTROL,"Fatal error: Needed Threads could not be started");
destroy_and_exit(-1);
}
// int i;
// for(i = 0; i<10; i++)
// {
// initiate_ike_sa_job_t *initiate_job;
//
// initiate_job = initiate_ike_sa_job_create("pinflb31");
// global_event_queue->add_relative(global_event_queue, (job_t*)initiate_job, i * 1000);
//
// }
logger->log(logger,CONTROL_MORE,"going to wait for exit signal");
/* go and handle signals*/
@@ -222,11 +234,13 @@ static status_t initialize_globals()
global_job_queue = job_queue_create();
global_event_queue = event_queue_create();
global_send_queue = send_queue_create();
global_configuration_manager = configuration_manager_create();
if ( (global_socket == NULL) ||
(global_job_queue == NULL) ||
(global_event_queue == NULL) ||
(global_send_queue == NULL) ||
(global_configuration_manager == NULL) ||
(global_ike_sa_manager == NULL))
{
return FAILED;
@@ -260,6 +274,10 @@ static void destroy_globals()
{
global_ike_sa_manager->destroy(global_ike_sa_manager);
}
if (global_ike_sa_manager != NULL)
{
global_configuration_manager->destroy(global_configuration_manager);
}
}
/**
@@ -339,6 +357,7 @@ static void destroy_and_exit(int exit_code)
logger->log(logger,CONTROL_MORE,"destroy logger");
global_logger_manager->destroy_logger(global_logger_manager,logger);
logger->log(logger,CONTROL_MORE,"destroy logger_manager");
logger->log(logger,CONTROL_MORE,"------------------------------------");
if (global_logger_manager != NULL)
{
global_logger_manager->destroy(global_logger_manager);
+2
View File
@@ -29,6 +29,7 @@
#include "queues/event_queue.h"
#include "utils/logger_manager.h"
#include "ike_sa_manager.h"
#include "configuration_manager.h"
extern socket_t *global_socket;
@@ -37,5 +38,6 @@ extern job_queue_t *global_job_queue;
extern event_queue_t *global_event_queue;
extern logger_manager_t *global_logger_manager;
extern ike_sa_manager_t *global_ike_sa_manager;
extern configuration_manager_t *global_configuration_manager;
#endif /*GLOBALS_H_*/