Moved scheduler_t to libhydra.
This commit is contained in:
@@ -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 \
|
||||
|
||||
@@ -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 \
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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>
|
||||
@@ -207,11 +206,6 @@ struct daemon_t {
|
||||
*/
|
||||
receiver_t *receiver;
|
||||
|
||||
/**
|
||||
* The Scheduler-Thread.
|
||||
*/
|
||||
scheduler_t *scheduler;
|
||||
|
||||
/**
|
||||
* The signaling bus.
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 =
|
||||
|
||||
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -57,6 +58,11 @@ struct hydra_t {
|
||||
*/
|
||||
processor_t *processor;
|
||||
|
||||
/**
|
||||
* schedule jobs
|
||||
*/
|
||||
scheduler_t *scheduler;
|
||||
|
||||
/**
|
||||
* name of the daemon that initialized the library
|
||||
*/
|
||||
|
||||
@@ -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>
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user