aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libcharon/Android.mk1
-rw-r--r--src/libcharon/Makefile.am1
-rw-r--r--src/libcharon/daemon.c2
-rw-r--r--src/libcharon/daemon.h6
-rw-r--r--src/libhydra/Android.mk3
-rw-r--r--src/libhydra/Makefile.am3
-rw-r--r--src/libhydra/hydra.c4
-rw-r--r--src/libhydra/hydra.h6
-rw-r--r--src/libhydra/processing/scheduler.c (renamed from src/libcharon/processing/scheduler.c)2
-rw-r--r--src/libhydra/processing/scheduler.h (renamed from src/libcharon/processing/scheduler.h)18
10 files changed, 24 insertions, 22 deletions
diff --git a/src/libcharon/Android.mk b/src/libcharon/Android.mk
index ed88a33ce..f275998d2 100644
--- a/src/libcharon/Android.mk
+++ b/src/libcharon/Android.mk
@@ -62,7 +62,6 @@ processing/jobs/send_keepalive_job.c processing/jobs/send_keepalive_job.h \
processing/jobs/roam_job.c processing/jobs/roam_job.h \
processing/jobs/update_sa_job.c processing/jobs/update_sa_job.h \
processing/jobs/inactivity_job.c processing/jobs/inactivity_job.h \
-processing/scheduler.c processing/scheduler.h \
sa/authenticators/authenticator.c sa/authenticators/authenticator.h \
sa/authenticators/eap_authenticator.c sa/authenticators/eap_authenticator.h \
sa/authenticators/eap/eap_method.c sa/authenticators/eap/eap_method.h \
diff --git a/src/libcharon/Makefile.am b/src/libcharon/Makefile.am
index fd7fbd306..9fc67c7b3 100644
--- a/src/libcharon/Makefile.am
+++ b/src/libcharon/Makefile.am
@@ -60,7 +60,6 @@ processing/jobs/send_keepalive_job.c processing/jobs/send_keepalive_job.h \
processing/jobs/roam_job.c processing/jobs/roam_job.h \
processing/jobs/update_sa_job.c processing/jobs/update_sa_job.h \
processing/jobs/inactivity_job.c processing/jobs/inactivity_job.h \
-processing/scheduler.c processing/scheduler.h \
sa/authenticators/authenticator.c sa/authenticators/authenticator.h \
sa/authenticators/eap_authenticator.c sa/authenticators/eap_authenticator.h \
sa/authenticators/eap/eap_method.c sa/authenticators/eap/eap_method.h \
diff --git a/src/libcharon/daemon.c b/src/libcharon/daemon.c
index 2267ac5f2..3e6ca0316 100644
--- a/src/libcharon/daemon.c
+++ b/src/libcharon/daemon.c
@@ -119,7 +119,6 @@ static void destroy(private_daemon_t *this)
DESTROY_IF(this->public.ike_sa_manager);
DESTROY_IF(this->kernel_handler);
DESTROY_IF(this->public.kernel_interface);
- DESTROY_IF(this->public.scheduler);
DESTROY_IF(this->public.controller);
DESTROY_IF(this->public.eap);
DESTROY_IF(this->public.sim);
@@ -365,7 +364,6 @@ METHOD(daemon_t, initialize, bool,
}
/* load secrets, ca certificates and crls */
- this->public.scheduler = scheduler_create();
this->public.controller = controller_create();
this->public.eap = eap_manager_create();
this->public.sim = sim_manager_create();
diff --git a/src/libcharon/daemon.h b/src/libcharon/daemon.h
index f469a55d1..b7d5d9f77 100644
--- a/src/libcharon/daemon.h
+++ b/src/libcharon/daemon.h
@@ -140,7 +140,6 @@ typedef struct daemon_t daemon_t;
#include <network/sender.h>
#include <network/receiver.h>
#include <network/socket_manager.h>
-#include <processing/scheduler.h>
#include <kernel/kernel_interface.h>
#include <control/controller.h>
#include <bus/bus.h>
@@ -208,11 +207,6 @@ struct daemon_t {
receiver_t *receiver;
/**
- * The Scheduler-Thread.
- */
- scheduler_t *scheduler;
-
- /**
* The signaling bus.
*/
bus_t *bus;
diff --git a/src/libhydra/Android.mk b/src/libhydra/Android.mk
index b94fc7f62..40fa00dff 100644
--- a/src/libhydra/Android.mk
+++ b/src/libhydra/Android.mk
@@ -10,7 +10,8 @@ attributes/attribute_manager.c attributes/attribute_manager.h \
attributes/mem_pool.c attributes/mem_pool.h \
processing/jobs/job.h \
processing/jobs/callback_job.c processing/jobs/callback_job.h \
-processing/processor.c processing/processor.h
+processing/processor.c processing/processor.h \
+processing/scheduler.c processing/scheduler.h
# adding the plugin source files
diff --git a/src/libhydra/Makefile.am b/src/libhydra/Makefile.am
index 1d32a121a..1de4aa201 100644
--- a/src/libhydra/Makefile.am
+++ b/src/libhydra/Makefile.am
@@ -8,7 +8,8 @@ attributes/attribute_manager.c attributes/attribute_manager.h \
attributes/mem_pool.c attributes/mem_pool.h \
processing/jobs/job.h \
processing/jobs/callback_job.c processing/jobs/callback_job.h \
-processing/processor.c processing/processor.h
+processing/processor.c processing/processor.h \
+processing/scheduler.c processing/scheduler.h
libhydra_la_LIBADD =
diff --git a/src/libhydra/hydra.c b/src/libhydra/hydra.c
index 2f3459517..5418802e8 100644
--- a/src/libhydra/hydra.c
+++ b/src/libhydra/hydra.c
@@ -42,6 +42,7 @@ void libhydra_deinit()
{
private_hydra_t *this = (private_hydra_t*)hydra;
this->public.attributes->destroy(this->public.attributes);
+ this->public.scheduler->destroy(this->public.scheduler);
this->public.processor->destroy(this->public.processor);
free((void*)this->public.daemon);
free(this);
@@ -64,6 +65,9 @@ bool libhydra_init(const char *daemon)
);
hydra = &this->public;
+ /* requires hydra->processor */
+ this->public.scheduler = scheduler_create();
+
if (lib->integrity &&
!lib->integrity->check(lib->integrity, "libhydra", libhydra_init))
{
diff --git a/src/libhydra/hydra.h b/src/libhydra/hydra.h
index 78d93bd83..2ae8bba76 100644
--- a/src/libhydra/hydra.h
+++ b/src/libhydra/hydra.h
@@ -39,6 +39,7 @@ typedef struct hydra_t hydra_t;
#include <attributes/attribute_manager.h>
#include <processing/processor.h>
+#include <processing/scheduler.h>
#include <library.h>
@@ -58,6 +59,11 @@ struct hydra_t {
processor_t *processor;
/**
+ * schedule jobs
+ */
+ scheduler_t *scheduler;
+
+ /**
* name of the daemon that initialized the library
*/
const char *daemon;
diff --git a/src/libcharon/processing/scheduler.c b/src/libhydra/processing/scheduler.c
index 85796ba18..8a58e4570 100644
--- a/src/libcharon/processing/scheduler.c
+++ b/src/libhydra/processing/scheduler.c
@@ -20,7 +20,7 @@
#include "scheduler.h"
#include <hydra.h>
-#include <daemon.h>
+#include <debug.h>
#include <processing/processor.h>
#include <processing/jobs/callback_job.h>
#include <threading/thread.h>
diff --git a/src/libcharon/processing/scheduler.h b/src/libhydra/processing/scheduler.h
index 9c97820b6..a3439553f 100644
--- a/src/libcharon/processing/scheduler.h
+++ b/src/libhydra/processing/scheduler.h
@@ -17,7 +17,7 @@
/**
* @defgroup scheduler scheduler
- * @{ @ingroup cprocessing
+ * @{ @ingroup hprocessing
*/
#ifndef SCHEDULER_H_
@@ -83,16 +83,16 @@ struct scheduler_t {
/**
* Adds a event to the queue, using a relative time offset in s.
*
- * @param job job to schedule
- * @param time relative time to schedule job, in s
+ * @param job job to schedule
+ * @param time relative time to schedule job, in s
*/
void (*schedule_job) (scheduler_t *this, job_t *job, u_int32_t s);
/**
* Adds a event to the queue, using a relative time offset in ms.
*
- * @param job job to schedule
- * @param time relative time to schedule job, in ms
+ * @param job job to schedule
+ * @param time relative time to schedule job, in ms
*/
void (*schedule_job_ms) (scheduler_t *this, job_t *job, u_int32_t ms);
@@ -102,15 +102,15 @@ struct scheduler_t {
* The passed timeval should be calculated based on the time_monotonic()
* function.
*
- * @param job job to schedule
- * @param time absolut time to schedule job
+ * @param job job to schedule
+ * @param time absolut time to schedule job
*/
void (*schedule_job_tv) (scheduler_t *this, job_t *job, timeval_t tv);
/**
* Returns number of jobs scheduled.
*
- * @return number of scheduled jobs
+ * @return number of scheduled jobs
*/
u_int (*get_job_load) (scheduler_t *this);
@@ -123,7 +123,7 @@ struct scheduler_t {
/**
* Create a scheduler.
*
- * @return scheduler_t object
+ * @return scheduler_t object
*/
scheduler_t *scheduler_create(void);