Refer to scheduler and processor via lib and not hydra.
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <hydra.h>
|
||||
#include <threading/thread.h>
|
||||
#include <threading/thread_value.h>
|
||||
#include <threading/condvar.h>
|
||||
@@ -163,7 +162,7 @@ METHOD(bus_t, listen_, void,
|
||||
|
||||
this->mutex->lock(this->mutex);
|
||||
this->listeners->insert_last(this->listeners, data.entry);
|
||||
hydra->processor->queue_job(hydra->processor, job);
|
||||
lib->processor->queue_job(lib->processor, job);
|
||||
thread_cleanup_push((thread_cleanup_t)this->mutex->unlock, this->mutex);
|
||||
thread_cleanup_push((thread_cleanup_t)listener_cleanup, &data);
|
||||
old = thread_cancelability(TRUE);
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include "daemon.h"
|
||||
|
||||
#include <library.h>
|
||||
#include <hydra.h>
|
||||
#include <config/proposal.h>
|
||||
#include <kernel/kernel_handler.h>
|
||||
|
||||
@@ -101,7 +100,7 @@ static void dbg_bus(debug_t group, level_t level, char *fmt, ...)
|
||||
static void destroy(private_daemon_t *this)
|
||||
{
|
||||
/* terminate all idle threads */
|
||||
hydra->processor->set_threads(hydra->processor, 0);
|
||||
lib->processor->set_threads(lib->processor, 0);
|
||||
|
||||
/* close all IKE_SAs */
|
||||
if (this->public.ike_sa_manager)
|
||||
@@ -178,7 +177,7 @@ METHOD(daemon_t, start, void,
|
||||
private_daemon_t *this)
|
||||
{
|
||||
/* start the engine, go multithreaded */
|
||||
hydra->processor->set_threads(hydra->processor,
|
||||
lib->processor->set_threads(lib->processor,
|
||||
lib->settings->get_int(lib->settings, "charon.threads",
|
||||
DEFAULT_THREADS));
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ METHOD(kernel_listener_t, acquire, bool,
|
||||
DBG1(DBG_KNL, "creating acquire job for policy with reqid {%u}", reqid);
|
||||
}
|
||||
job = (job_t*)acquire_job_create(reqid, src_ts, dst_ts);
|
||||
hydra->processor->queue_job(hydra->processor, job);
|
||||
lib->processor->queue_job(lib->processor, job);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ METHOD(kernel_listener_t, expire, bool,
|
||||
{
|
||||
job = (job_t*)rekey_child_sa_job_create(reqid, proto, spi);
|
||||
}
|
||||
hydra->processor->queue_job(hydra->processor, job);
|
||||
lib->processor->queue_job(lib->processor, job);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ METHOD(kernel_listener_t, mapping, bool,
|
||||
DBG1(DBG_KNL, "NAT mappings of ESP CHILD_SA with SPI %.8x and "
|
||||
"reqid {%u} changed, queuing update job", ntohl(spi), reqid);
|
||||
job = (job_t*)update_sa_job_create(reqid, remote);
|
||||
hydra->processor->queue_job(hydra->processor, job);
|
||||
lib->processor->queue_job(lib->processor, job);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ METHOD(kernel_listener_t, migrate, bool,
|
||||
reqid, local);
|
||||
job = (job_t*)migrate_job_create(reqid, src_ts, dst_ts, direction, local,
|
||||
remote);
|
||||
hydra->processor->queue_job(hydra->processor, job);
|
||||
lib->processor->queue_job(lib->processor, job);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ METHOD(kernel_listener_t, roam, bool,
|
||||
{
|
||||
job_t *job;
|
||||
job = (job_t*)roam_job_create(address);
|
||||
hydra->processor->queue_job(hydra->processor, job);
|
||||
lib->processor->queue_job(lib->processor, job);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
#include "receiver.h"
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <network/socket.h>
|
||||
#include <network/packet.h>
|
||||
@@ -354,15 +353,15 @@ static job_requeue_t receive_packets(private_receiver_t *this)
|
||||
{
|
||||
DBG1(DBG_NET, "using receive delay: %dms",
|
||||
this->receive_delay);
|
||||
hydra->scheduler->schedule_job_ms(hydra->scheduler,
|
||||
lib->scheduler->schedule_job_ms(lib->scheduler,
|
||||
(job_t*)process_message_job_create(message),
|
||||
this->receive_delay);
|
||||
return JOB_REQUEUE_DIRECT;
|
||||
}
|
||||
}
|
||||
}
|
||||
hydra->processor->queue_job(hydra->processor,
|
||||
(job_t*)process_message_job_create(message));
|
||||
lib->processor->queue_job(lib->processor,
|
||||
(job_t*)process_message_job_create(message));
|
||||
return JOB_REQUEUE_DIRECT;
|
||||
}
|
||||
|
||||
@@ -427,7 +426,7 @@ receiver_t *receiver_create()
|
||||
|
||||
this->job = callback_job_create((callback_job_cb_t)receive_packets,
|
||||
this, NULL, NULL);
|
||||
hydra->processor->queue_job(hydra->processor, (job_t*)this->job);
|
||||
lib->processor->queue_job(lib->processor, (job_t*)this->job);
|
||||
|
||||
return &this->public;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
#include "sender.h"
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <network/socket.h>
|
||||
#include <processing/jobs/callback_job.h>
|
||||
@@ -196,7 +195,7 @@ sender_t * sender_create()
|
||||
"charon.send_delay_response", TRUE),
|
||||
);
|
||||
|
||||
hydra->processor->queue_job(hydra->processor, (job_t*)this->job);
|
||||
lib->processor->queue_job(lib->processor, (job_t*)this->job);
|
||||
|
||||
return &this->public;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
#include "android_service.h"
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <threading/thread.h>
|
||||
#include <processing/jobs/callback_job.h>
|
||||
@@ -142,7 +141,7 @@ METHOD(listener_t, child_updown, bool,
|
||||
* callback, but from a different thread. we also delay it to avoid
|
||||
* a race condition during a regular shutdown */
|
||||
job = callback_job_create(shutdown_callback, NULL, NULL, NULL);
|
||||
hydra->scheduler->schedule_job(hydra->scheduler, (job_t*)job, 1);
|
||||
lib->scheduler->schedule_job(lib->scheduler, (job_t*)job, 1);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -379,7 +378,7 @@ android_service_t *android_service_create(android_creds_t *creds)
|
||||
charon->bus->add_listener(charon->bus, &this->public.listener);
|
||||
this->job = callback_job_create((callback_job_cb_t)initiate, this,
|
||||
NULL, NULL);
|
||||
hydra->processor->queue_job(hydra->processor, (job_t*)this->job);
|
||||
lib->processor->queue_job(lib->processor, (job_t*)this->job);
|
||||
|
||||
return &this->public;
|
||||
}
|
||||
|
||||
@@ -752,7 +752,7 @@ dhcp_socket_t *dhcp_socket_create()
|
||||
|
||||
this->job = callback_job_create((callback_job_cb_t)receive_dhcp,
|
||||
this, NULL, NULL);
|
||||
hydra->processor->queue_job(hydra->processor, (job_t*)this->job);
|
||||
lib->processor->queue_job(lib->processor, (job_t*)this->job);
|
||||
|
||||
return &this->public;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include <linux/filter.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <threading/thread.h>
|
||||
#include <processing/jobs/callback_job.h>
|
||||
@@ -192,7 +191,7 @@ farp_spoofer_t *farp_spoofer_create(farp_listener_t *listener)
|
||||
|
||||
this->job = callback_job_create((callback_job_cb_t)receive_arp,
|
||||
this, NULL, NULL);
|
||||
hydra->processor->queue_job(hydra->processor, (job_t*)this->job);
|
||||
lib->processor->queue_job(lib->processor, (job_t*)this->job);
|
||||
|
||||
return &this->public;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include <errno.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include <hydra.h>
|
||||
#include <processing/jobs/callback_job.h>
|
||||
|
||||
#define HA_FIFO IPSEC_PIDDIR "/charon.ha"
|
||||
@@ -135,7 +134,7 @@ ha_ctl_t *ha_ctl_create(ha_segments_t *segments, ha_cache_t *cache)
|
||||
|
||||
this->job = callback_job_create((callback_job_cb_t)dispatch_fifo,
|
||||
this, NULL, NULL);
|
||||
hydra->processor->queue_job(hydra->processor, (job_t*)this->job);
|
||||
lib->processor->queue_job(lib->processor, (job_t*)this->job);
|
||||
return &this->public;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
|
||||
#include "ha_dispatcher.h"
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <processing/jobs/callback_job.h>
|
||||
|
||||
@@ -870,7 +869,7 @@ ha_dispatcher_t *ha_dispatcher_create(ha_socket_t *socket,
|
||||
);
|
||||
this->job = callback_job_create((callback_job_cb_t)dispatch,
|
||||
this, NULL, NULL);
|
||||
hydra->processor->queue_job(hydra->processor, (job_t*)this->job);
|
||||
lib->processor->queue_job(lib->processor, (job_t*)this->job);
|
||||
|
||||
return &this->public;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
#include <hydra.h>
|
||||
#include <threading/mutex.h>
|
||||
#include <threading/condvar.h>
|
||||
#include <utils/linked_list.h>
|
||||
@@ -284,7 +283,7 @@ static void start_watchdog(private_ha_segments_t *this)
|
||||
{
|
||||
this->job = callback_job_create((callback_job_cb_t)watchdog,
|
||||
this, NULL, NULL);
|
||||
hydra->processor->queue_job(hydra->processor, (job_t*)this->job);
|
||||
lib->processor->queue_job(lib->processor, (job_t*)this->job);
|
||||
}
|
||||
|
||||
METHOD(ha_segments_t, handle_status, void,
|
||||
@@ -346,7 +345,7 @@ static job_requeue_t send_status(private_ha_segments_t *this)
|
||||
message->destroy(message);
|
||||
|
||||
/* schedule next invocation */
|
||||
hydra->scheduler->schedule_job_ms(hydra->scheduler, (job_t*)
|
||||
lib->scheduler->schedule_job_ms(lib->scheduler, (job_t*)
|
||||
callback_job_create((callback_job_cb_t)
|
||||
send_status, this, NULL, NULL),
|
||||
this->heartbeat_delay);
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include <unistd.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <utils/host.h>
|
||||
#include <processing/jobs/callback_job.h>
|
||||
@@ -108,7 +107,7 @@ METHOD(ha_socket_t, push, void,
|
||||
|
||||
job = callback_job_create((callback_job_cb_t)send_message,
|
||||
data, (void*)job_data_destroy, NULL);
|
||||
hydra->processor->queue_job(hydra->processor, (job_t*)job);
|
||||
lib->processor->queue_job(lib->processor, (job_t*)job);
|
||||
return;
|
||||
}
|
||||
DBG1(DBG_CFG, "pushing HA message failed: %s", strerror(errno));
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <processing/jobs/delete_ike_sa_job.h>
|
||||
|
||||
@@ -60,7 +59,7 @@ static bool ike_state_change(private_load_tester_listener_t *this,
|
||||
|
||||
if (this->delete_after_established)
|
||||
{
|
||||
hydra->processor->queue_job(hydra->processor,
|
||||
lib->processor->queue_job(lib->processor,
|
||||
(job_t*)delete_ike_sa_job_create(id, TRUE));
|
||||
}
|
||||
|
||||
|
||||
@@ -222,7 +222,7 @@ plugin_t *load_tester_plugin_create()
|
||||
this->running = 0;
|
||||
for (i = 0; i < this->initiators; i++)
|
||||
{
|
||||
hydra->processor->queue_job(hydra->processor,
|
||||
lib->processor->queue_job(lib->processor,
|
||||
(job_t*)callback_job_create((callback_job_cb_t)do_load_test,
|
||||
this, NULL, NULL));
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
#include "medcli_config.h"
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <processing/jobs/callback_job.h>
|
||||
|
||||
@@ -365,7 +364,7 @@ static void schedule_autoinit(private_medcli_config_t *this)
|
||||
if (peer_cfg)
|
||||
{
|
||||
/* schedule asynchronous initiation job */
|
||||
hydra->processor->queue_job(hydra->processor,
|
||||
lib->processor->queue_job(lib->processor,
|
||||
(job_t*)callback_job_create(
|
||||
(callback_job_cb_t)initiate_config,
|
||||
peer_cfg, (void*)peer_cfg->destroy, NULL));
|
||||
|
||||
@@ -122,7 +122,7 @@ plugin_t *nm_plugin_create()
|
||||
/* bypass file permissions to read from users ssh-agent */
|
||||
charon->keep_cap(charon, CAP_DAC_OVERRIDE);
|
||||
|
||||
hydra->processor->queue_job(hydra->processor,
|
||||
lib->processor->queue_job(lib->processor,
|
||||
(job_t*)callback_job_create((callback_job_cb_t)run, this, NULL, NULL));
|
||||
|
||||
return &this->public.plugin;
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include <libxml/xmlwriter.h>
|
||||
|
||||
#include <library.h>
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <threading/thread.h>
|
||||
#include <processing/jobs/callback_job.h>
|
||||
@@ -703,7 +702,7 @@ static job_requeue_t dispatch(private_smp_t *this)
|
||||
fdp = malloc_thing(int);
|
||||
*fdp = fd;
|
||||
job = callback_job_create((callback_job_cb_t)process, fdp, free, this->job);
|
||||
hydra->processor->queue_job(hydra->processor, (job_t*)job);
|
||||
lib->processor->queue_job(lib->processor, (job_t*)job);
|
||||
|
||||
return JOB_REQUEUE_DIRECT;
|
||||
}
|
||||
@@ -762,7 +761,7 @@ plugin_t *smp_plugin_create()
|
||||
}
|
||||
|
||||
this->job = callback_job_create((callback_job_cb_t)dispatch, this, NULL, NULL);
|
||||
hydra->processor->queue_job(hydra->processor, (job_t*)this->job);
|
||||
lib->processor->queue_job(lib->processor, (job_t*)this->job);
|
||||
|
||||
return &this->public.plugin;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
|
||||
#include "stroke_control.h"
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <processing/jobs/delete_ike_sa_job.h>
|
||||
|
||||
@@ -355,7 +354,7 @@ static void terminate_srcip(private_stroke_control_t *this,
|
||||
}
|
||||
|
||||
/* schedule delete asynchronously */
|
||||
hydra->processor->queue_job(hydra->processor, (job_t*)
|
||||
lib->processor->queue_job(lib->processor, (job_t*)
|
||||
delete_ike_sa_job_create(ike_sa->get_id(ike_sa), TRUE));
|
||||
}
|
||||
enumerator->destroy(enumerator);
|
||||
|
||||
@@ -423,12 +423,12 @@ static void status(private_stroke_list_t *this, stroke_msg_t *msg, FILE *out, bo
|
||||
}
|
||||
#endif /* HAVE_MALLINFO */
|
||||
fprintf(out, " worker threads: %d idle of %d,",
|
||||
hydra->processor->get_idle_threads(hydra->processor),
|
||||
hydra->processor->get_total_threads(hydra->processor));
|
||||
lib->processor->get_idle_threads(lib->processor),
|
||||
lib->processor->get_total_threads(lib->processor));
|
||||
fprintf(out, " job queue load: %d,",
|
||||
hydra->processor->get_job_load(hydra->processor));
|
||||
lib->processor->get_job_load(lib->processor));
|
||||
fprintf(out, " scheduled events: %d\n",
|
||||
hydra->scheduler->get_job_load(hydra->scheduler));
|
||||
lib->scheduler->get_job_load(lib->scheduler));
|
||||
fprintf(out, " loaded plugins: ");
|
||||
enumerator = lib->plugins->create_plugin_enumerator(lib->plugins);
|
||||
while (enumerator->enumerate(enumerator, &plugin))
|
||||
|
||||
@@ -586,7 +586,7 @@ static job_requeue_t receive(private_stroke_socket_t *this)
|
||||
ctx->this = this;
|
||||
job = callback_job_create((callback_job_cb_t)process,
|
||||
ctx, (void*)stroke_job_context_destroy, this->job);
|
||||
hydra->processor->queue_job(hydra->processor, (job_t*)job);
|
||||
lib->processor->queue_job(lib->processor, (job_t*)job);
|
||||
|
||||
return JOB_REQUEUE_FAIR;
|
||||
}
|
||||
@@ -684,7 +684,7 @@ stroke_socket_t *stroke_socket_create()
|
||||
|
||||
this->job = callback_job_create((callback_job_cb_t)receive,
|
||||
this, NULL, NULL);
|
||||
hydra->processor->queue_job(hydra->processor, (job_t*)this->job);
|
||||
lib->processor->queue_job(lib->processor, (job_t*)this->job);
|
||||
|
||||
return &this->public;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
#include "uci_control.h"
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <threading/thread.h>
|
||||
#include <processing/jobs/callback_job.h>
|
||||
@@ -295,7 +294,7 @@ uci_control_t *uci_control_create()
|
||||
{
|
||||
this->job = callback_job_create((callback_job_cb_t)receive,
|
||||
this, NULL, NULL);
|
||||
hydra->processor->queue_job(hydra->processor, (job_t*)this->job);
|
||||
lib->processor->queue_job(lib->processor, (job_t*)this->job);
|
||||
}
|
||||
return &this->public;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
|
||||
#include "inactivity_job.h"
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
|
||||
typedef struct private_inactivity_job_t private_inactivity_job_t;
|
||||
@@ -88,7 +87,7 @@ METHOD(job_t, execute, void,
|
||||
}
|
||||
else
|
||||
{
|
||||
hydra->scheduler->schedule_job(hydra->scheduler,
|
||||
lib->scheduler->schedule_job(lib->scheduler,
|
||||
&this->public.job_interface, this->timeout - diff);
|
||||
rescheduled = TRUE;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <threading/mutex.h>
|
||||
#include <utils/linked_list.h>
|
||||
@@ -933,7 +932,7 @@ static void update_checklist_state(private_connect_manager_t *this,
|
||||
|
||||
callback_data_t *data = callback_data_create(this, checklist->connect_id);
|
||||
job_t *job = (job_t*)callback_job_create((callback_job_cb_t)initiator_finish, data, (callback_job_cleanup_t)callback_data_destroy, NULL);
|
||||
hydra->scheduler->schedule_job_ms(hydra->scheduler, job, ME_WAIT_TO_FINISH);
|
||||
lib->scheduler->schedule_job_ms(lib->scheduler, job, ME_WAIT_TO_FINISH);
|
||||
checklist->is_finishing = TRUE;
|
||||
}
|
||||
|
||||
@@ -1032,7 +1031,7 @@ static void queue_retransmission(private_connect_manager_t *this, check_list_t *
|
||||
DBG2(DBG_IKE, "scheduling retransmission %d of pair '%d' in %dms",
|
||||
retransmission, pair->id, rto);
|
||||
|
||||
hydra->scheduler->schedule_job_ms(hydra->scheduler, (job_t*)job, rto);
|
||||
lib->scheduler->schedule_job_ms(lib->scheduler, (job_t*)job, rto);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1171,7 +1170,7 @@ static void schedule_checks(private_connect_manager_t *this, check_list_t *check
|
||||
{
|
||||
callback_data_t *data = callback_data_create(this, checklist->connect_id);
|
||||
checklist->sender = (job_t*)callback_job_create((callback_job_cb_t)sender, data, (callback_job_cleanup_t)callback_data_destroy, NULL);
|
||||
hydra->scheduler->schedule_job_ms(hydra->scheduler, checklist->sender, time);
|
||||
lib->scheduler->schedule_job_ms(lib->scheduler, checklist->sender, time);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1223,7 +1222,7 @@ static void finish_checks(private_connect_manager_t *this, check_list_t *checkli
|
||||
|
||||
initiate_data_t *data = initiate_data_create(checklist, initiated);
|
||||
job_t *job = (job_t*)callback_job_create((callback_job_cb_t)initiate_mediated, data, (callback_job_cleanup_t)initiate_data_destroy, NULL);
|
||||
hydra->processor->queue_job(hydra->processor, job);
|
||||
lib->processor->queue_job(lib->processor, job);
|
||||
return;
|
||||
}
|
||||
else
|
||||
@@ -1478,7 +1477,7 @@ static void check_and_initiate(private_connect_manager_t *this,
|
||||
{
|
||||
job_t *job = (job_t*)reinitiate_mediation_job_create(mediation_sa,
|
||||
waiting_sa);
|
||||
hydra->processor->queue_job(hydra->processor, job);
|
||||
lib->processor->queue_job(lib->processor, job);
|
||||
}
|
||||
iterator->destroy(iterator);
|
||||
|
||||
|
||||
+15
-15
@@ -470,8 +470,8 @@ METHOD(ike_sa_t, send_keepalive, void,
|
||||
diff = 0;
|
||||
}
|
||||
job = send_keepalive_job_create(this->ike_sa_id);
|
||||
hydra->scheduler->schedule_job(hydra->scheduler, (job_t*)job,
|
||||
this->keepalive_interval - diff);
|
||||
lib->scheduler->schedule_job(lib->scheduler, (job_t*)job,
|
||||
this->keepalive_interval - diff);
|
||||
}
|
||||
|
||||
METHOD(ike_sa_t, get_ike_cfg, ike_cfg_t*,
|
||||
@@ -605,7 +605,7 @@ METHOD(ike_sa_t, send_dpd, status_t,
|
||||
}
|
||||
/* recheck in "interval" seconds */
|
||||
job = (job_t*)send_dpd_job_create(this->ike_sa_id);
|
||||
hydra->scheduler->schedule_job(hydra->scheduler, job, delay - diff);
|
||||
lib->scheduler->schedule_job(lib->scheduler, job, delay - diff);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -644,7 +644,7 @@ METHOD(ike_sa_t, set_state, void,
|
||||
{
|
||||
this->stats[STAT_REKEY] = t + this->stats[STAT_ESTABLISHED];
|
||||
job = (job_t*)rekey_ike_sa_job_create(this->ike_sa_id, FALSE);
|
||||
hydra->scheduler->schedule_job(hydra->scheduler, job, t);
|
||||
lib->scheduler->schedule_job(lib->scheduler, job, t);
|
||||
DBG1(DBG_IKE, "scheduling rekeying in %ds", t);
|
||||
}
|
||||
t = this->peer_cfg->get_reauth_time(this->peer_cfg);
|
||||
@@ -653,7 +653,7 @@ METHOD(ike_sa_t, set_state, void,
|
||||
{
|
||||
this->stats[STAT_REAUTH] = t + this->stats[STAT_ESTABLISHED];
|
||||
job = (job_t*)rekey_ike_sa_job_create(this->ike_sa_id, TRUE);
|
||||
hydra->scheduler->schedule_job(hydra->scheduler, job, t);
|
||||
lib->scheduler->schedule_job(lib->scheduler, job, t);
|
||||
DBG1(DBG_IKE, "scheduling reauthentication in %ds", t);
|
||||
}
|
||||
t = this->peer_cfg->get_over_time(this->peer_cfg);
|
||||
@@ -675,7 +675,7 @@ METHOD(ike_sa_t, set_state, void,
|
||||
this->stats[STAT_DELETE] += t;
|
||||
t = this->stats[STAT_DELETE] - this->stats[STAT_ESTABLISHED];
|
||||
job = (job_t*)delete_ike_sa_job_create(this->ike_sa_id, TRUE);
|
||||
hydra->scheduler->schedule_job(hydra->scheduler, job, t);
|
||||
lib->scheduler->schedule_job(lib->scheduler, job, t);
|
||||
DBG1(DBG_IKE, "maximum IKE_SA lifetime %ds", t);
|
||||
}
|
||||
|
||||
@@ -688,8 +688,8 @@ METHOD(ike_sa_t, set_state, void,
|
||||
{
|
||||
/* delete may fail if a packet gets lost, so set a timeout */
|
||||
job_t *job = (job_t*)delete_ike_sa_job_create(this->ike_sa_id, TRUE);
|
||||
hydra->scheduler->schedule_job(hydra->scheduler, job,
|
||||
HALF_OPEN_IKE_SA_TIMEOUT);
|
||||
lib->scheduler->schedule_job(lib->scheduler, job,
|
||||
HALF_OPEN_IKE_SA_TIMEOUT);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -1163,7 +1163,7 @@ METHOD(ike_sa_t, initiate, status_t,
|
||||
{
|
||||
/* mediated connection, initiate mediation process */
|
||||
job_t *job = (job_t*)initiate_mediation_job_create(this->ike_sa_id);
|
||||
hydra->processor->queue_job(hydra->processor, job);
|
||||
lib->processor->queue_job(lib->processor, job);
|
||||
return SUCCESS;
|
||||
}
|
||||
#endif /* ME */
|
||||
@@ -1262,8 +1262,8 @@ METHOD(ike_sa_t, process_message, status_t,
|
||||
}
|
||||
/* add a timeout if peer does not establish it completely */
|
||||
job = (job_t*)delete_ike_sa_job_create(this->ike_sa_id, FALSE);
|
||||
hydra->scheduler->schedule_job(hydra->scheduler, job,
|
||||
HALF_OPEN_IKE_SA_TIMEOUT);
|
||||
lib->scheduler->schedule_job(lib->scheduler, job,
|
||||
HALF_OPEN_IKE_SA_TIMEOUT);
|
||||
}
|
||||
this->stats[STAT_INBOUND] = time_monotonic(NULL);
|
||||
/* check if message is trustworthy, and update host information */
|
||||
@@ -1709,7 +1709,7 @@ METHOD(ike_sa_t, set_auth_lifetime, void,
|
||||
{
|
||||
DBG1(DBG_IKE, "received AUTH_LIFETIME of %ds, starting reauthentication",
|
||||
lifetime);
|
||||
hydra->processor->queue_job(hydra->processor,
|
||||
lib->processor->queue_job(lib->processor,
|
||||
(job_t*)rekey_ike_sa_job_create(this->ike_sa_id, TRUE));
|
||||
}
|
||||
else if (this->stats[STAT_REAUTH] == 0 ||
|
||||
@@ -1718,7 +1718,7 @@ METHOD(ike_sa_t, set_auth_lifetime, void,
|
||||
this->stats[STAT_REAUTH] = reauth_time;
|
||||
DBG1(DBG_IKE, "received AUTH_LIFETIME of %ds, scheduling reauthentication"
|
||||
" in %ds", lifetime, lifetime - reduction);
|
||||
hydra->scheduler->schedule_job(hydra->scheduler,
|
||||
lib->scheduler->schedule_job(lib->scheduler,
|
||||
(job_t*)rekey_ike_sa_job_create(this->ike_sa_id, TRUE),
|
||||
lifetime - reduction);
|
||||
}
|
||||
@@ -1919,9 +1919,9 @@ METHOD(ike_sa_t, inherit, status_t,
|
||||
this->stats[STAT_DELETE] = this->stats[STAT_REAUTH] + delete;
|
||||
DBG1(DBG_IKE, "rescheduling reauthentication in %ds after rekeying, "
|
||||
"lifetime reduced to %ds", reauth, delete);
|
||||
hydra->scheduler->schedule_job(hydra->scheduler,
|
||||
lib->scheduler->schedule_job(lib->scheduler,
|
||||
(job_t*)rekey_ike_sa_job_create(this->ike_sa_id, TRUE), reauth);
|
||||
hydra->scheduler->schedule_job(hydra->scheduler,
|
||||
lib->scheduler->schedule_job(lib->scheduler,
|
||||
(job_t*)delete_ike_sa_job_create(this->ike_sa_id, TRUE), delete);
|
||||
}
|
||||
/* we have to initate here, there may be new tasks to handle */
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
|
||||
#include "mediation_manager.h"
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <threading/mutex.h>
|
||||
#include <utils/linked_list.h>
|
||||
@@ -242,7 +241,7 @@ static void update_sa_id(private_mediation_manager_t *this, identification_t *pe
|
||||
(void**)&requester) == SUCCESS)
|
||||
{
|
||||
job_t *job = (job_t*)mediation_callback_job_create(requester, peer_id);
|
||||
hydra->processor->queue_job(hydra->processor, job);
|
||||
lib->processor->queue_job(lib->processor, job);
|
||||
requester->destroy(requester);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <sa/tasks/ike_init.h>
|
||||
#include <sa/tasks/ike_natd.h>
|
||||
@@ -275,7 +274,7 @@ METHOD(task_manager_t, retransmit, status_t,
|
||||
this->initiating.retransmitted++;
|
||||
job = (job_t*)retransmit_job_create(this->initiating.mid,
|
||||
this->ike_sa->get_id(this->ike_sa));
|
||||
hydra->scheduler->schedule_job_ms(hydra->scheduler, job, timeout);
|
||||
lib->scheduler->schedule_job_ms(lib->scheduler, job, timeout);
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
#include "child_create.h"
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <crypto/diffie_hellman.h>
|
||||
#include <credentials/certificates/x509.h>
|
||||
@@ -262,7 +261,7 @@ static void schedule_inactivity_timeout(private_child_create_t *this)
|
||||
{
|
||||
close_ike = lib->settings->get_bool(lib->settings,
|
||||
"charon.inactivity_close_ike", FALSE);
|
||||
hydra->scheduler->schedule_job(hydra->scheduler, (job_t*)
|
||||
lib->scheduler->schedule_job(lib->scheduler, (job_t*)
|
||||
inactivity_job_create(this->child_sa->get_reqid(this->child_sa),
|
||||
timeout, close_ike), timeout);
|
||||
}
|
||||
@@ -872,7 +871,7 @@ static void handle_child_sa_failure(private_child_create_t *this,
|
||||
/* we delay the delete for 100ms, as the IKE_AUTH response must arrive
|
||||
* first */
|
||||
DBG1(DBG_IKE, "closing IKE_SA due CHILD_SA setup failure");
|
||||
hydra->scheduler->schedule_job_ms(hydra->scheduler, (job_t*)
|
||||
lib->scheduler->schedule_job_ms(lib->scheduler, (job_t*)
|
||||
delete_ike_sa_job_create(this->ike_sa->get_id(this->ike_sa), TRUE),
|
||||
100);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
#include "child_rekey.h"
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <encoding/payloads/notify_payload.h>
|
||||
#include <sa/tasks/child_create.h>
|
||||
@@ -300,7 +299,7 @@ static status_t process_i(private_child_rekey_t *this, message_t *message)
|
||||
DBG1(DBG_IKE, "peer seems to not support CHILD_SA rekeying, "
|
||||
"starting reauthentication");
|
||||
this->child_sa->set_state(this->child_sa, CHILD_INSTALLED);
|
||||
hydra->processor->queue_job(hydra->processor,
|
||||
lib->processor->queue_job(lib->processor,
|
||||
(job_t*)rekey_ike_sa_job_create(
|
||||
this->ike_sa->get_id(this->ike_sa), TRUE));
|
||||
return SUCCESS;
|
||||
@@ -330,7 +329,7 @@ static status_t process_i(private_child_rekey_t *this, message_t *message)
|
||||
DBG1(DBG_IKE, "CHILD_SA rekeying failed, "
|
||||
"trying again in %d seconds", retry);
|
||||
this->child_sa->set_state(this->child_sa, CHILD_INSTALLED);
|
||||
hydra->scheduler->schedule_job(hydra->scheduler, job, retry);
|
||||
lib->scheduler->schedule_job(lib->scheduler, job, retry);
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -693,7 +693,7 @@ static status_t build_r_ms(private_ike_me_t *this, message_t *message)
|
||||
job_t *job = (job_t*)mediation_job_create(this->peer_id,
|
||||
this->ike_sa->get_other_id(this->ike_sa), this->connect_id,
|
||||
this->connect_key, this->remote_endpoints, this->response);
|
||||
hydra->processor->queue_job(hydra->processor, job);
|
||||
lib->processor->queue_job(lib->processor, job);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
#include "ike_rekey.h"
|
||||
|
||||
#include <hydra.h>
|
||||
#include <daemon.h>
|
||||
#include <encoding/payloads/notify_payload.h>
|
||||
#include <sa/tasks/ike_init.h>
|
||||
@@ -197,7 +196,7 @@ static status_t process_i(private_ike_rekey_t *this, message_t *message)
|
||||
DBG1(DBG_IKE, "peer seems to not support IKE rekeying, "
|
||||
"starting reauthentication");
|
||||
this->ike_sa->set_state(this->ike_sa, IKE_ESTABLISHED);
|
||||
hydra->processor->queue_job(hydra->processor,
|
||||
lib->processor->queue_job(lib->processor,
|
||||
(job_t*)rekey_ike_sa_job_create(
|
||||
this->ike_sa->get_id(this->ike_sa), TRUE));
|
||||
return SUCCESS;
|
||||
@@ -218,7 +217,7 @@ static status_t process_i(private_ike_rekey_t *this, message_t *message)
|
||||
DBG1(DBG_IKE, "IKE_SA rekeying failed, "
|
||||
"trying again in %d seconds", retry);
|
||||
this->ike_sa->set_state(this->ike_sa, IKE_ESTABLISHED);
|
||||
hydra->scheduler->schedule_job(hydra->scheduler, job, retry);
|
||||
lib->scheduler->schedule_job(lib->scheduler, job, retry);
|
||||
}
|
||||
return SUCCESS;
|
||||
case NEED_MORE:
|
||||
@@ -261,7 +260,7 @@ static status_t process_i(private_ike_rekey_t *this, message_t *message)
|
||||
/* peer should delete this SA. Add a timeout just in case. */
|
||||
job_t *job = (job_t*)delete_ike_sa_job_create(
|
||||
other->new_sa->get_id(other->new_sa), TRUE);
|
||||
hydra->scheduler->schedule_job(hydra->scheduler, job, 10);
|
||||
lib->scheduler->schedule_job(lib->scheduler, job, 10);
|
||||
DBG1(DBG_IKE, "IKE_SA rekey collision won, deleting rekeyed IKE_SA");
|
||||
charon->ike_sa_manager->checkin(charon->ike_sa_manager, other->new_sa);
|
||||
other->new_sa = NULL;
|
||||
|
||||
@@ -1509,7 +1509,7 @@ static void schedule_expire(private_kernel_klips_ipsec_t *this,
|
||||
expire->reqid = reqid;
|
||||
expire->type = type;
|
||||
job = callback_job_create((callback_job_cb_t)sa_expires, expire, free, NULL);
|
||||
hydra->scheduler->schedule_job(hydra->scheduler, (job_t*)job, time);
|
||||
lib->scheduler->schedule_job(lib->scheduler, (job_t*)job, time);
|
||||
}
|
||||
|
||||
METHOD(kernel_ipsec_t, get_spi, status_t,
|
||||
@@ -2632,7 +2632,7 @@ kernel_klips_ipsec_t *kernel_klips_ipsec_create()
|
||||
|
||||
this->job = callback_job_create((callback_job_cb_t)receive_events,
|
||||
this, NULL, NULL);
|
||||
hydra->processor->queue_job(hydra->processor, (job_t*)this->job);
|
||||
lib->processor->queue_job(lib->processor, (job_t*)this->job);
|
||||
|
||||
return &this->public;
|
||||
}
|
||||
|
||||
@@ -2201,7 +2201,7 @@ kernel_netlink_ipsec_t *kernel_netlink_ipsec_create()
|
||||
}
|
||||
this->job = callback_job_create((callback_job_cb_t)receive_events,
|
||||
this, NULL, NULL);
|
||||
hydra->processor->queue_job(hydra->processor, (job_t*)this->job);
|
||||
lib->processor->queue_job(lib->processor, (job_t*)this->job);
|
||||
|
||||
return &this->public;
|
||||
}
|
||||
|
||||
@@ -254,7 +254,7 @@ static void fire_roam_event(private_kernel_netlink_net_t *this, bool address)
|
||||
job = (job_t*)callback_job_create((callback_job_cb_t)roam_event,
|
||||
(void*)(uintptr_t)(address ? 1 : 0),
|
||||
NULL, NULL);
|
||||
hydra->scheduler->schedule_job_ms(hydra->scheduler, job, ROAM_DELAY);
|
||||
lib->scheduler->schedule_job_ms(lib->scheduler, job, ROAM_DELAY);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1492,7 +1492,7 @@ kernel_netlink_net_t *kernel_netlink_net_create()
|
||||
|
||||
this->job = callback_job_create((callback_job_cb_t)receive_events,
|
||||
this, NULL, NULL);
|
||||
hydra->processor->queue_job(hydra->processor, (job_t*)this->job);
|
||||
lib->processor->queue_job(lib->processor, (job_t*)this->job);
|
||||
|
||||
if (init_address_list(this) != SUCCESS)
|
||||
{
|
||||
|
||||
@@ -2166,7 +2166,7 @@ kernel_pfkey_ipsec_t *kernel_pfkey_ipsec_create()
|
||||
|
||||
this->job = callback_job_create((callback_job_cb_t)receive_events,
|
||||
this, NULL, NULL);
|
||||
hydra->processor->queue_job(hydra->processor, (job_t*)this->job);
|
||||
lib->processor->queue_job(lib->processor, (job_t*)this->job);
|
||||
|
||||
return &this->public;
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ static void fire_roam_event(private_kernel_pfroute_net_t *this, bool address)
|
||||
job = (job_t*)callback_job_create((callback_job_cb_t)roam_event,
|
||||
(void*)(uintptr_t)(address ? 1 : 0),
|
||||
NULL, NULL);
|
||||
hydra->scheduler->schedule_job_ms(hydra->scheduler, job, ROAM_DELAY);
|
||||
lib->scheduler->schedule_job_ms(lib->scheduler, job, ROAM_DELAY);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -729,7 +729,7 @@ kernel_pfroute_net_t *kernel_pfroute_net_create()
|
||||
|
||||
this->job = callback_job_create((callback_job_cb_t)receive_events,
|
||||
this, NULL, NULL);
|
||||
hydra->processor->queue_job(hydra->processor, (job_t*)this->job);
|
||||
lib->processor->queue_job(lib->processor, (job_t*)this->job);
|
||||
|
||||
if (init_address_list(this) != SUCCESS)
|
||||
{
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
#include <semaphore.h>
|
||||
|
||||
#include <hydra.h>
|
||||
#include <threading/thread.h>
|
||||
#include <threading/condvar.h>
|
||||
#include <threading/mutex.h>
|
||||
@@ -227,8 +226,8 @@ static void execute(private_callback_job_t *this)
|
||||
thread_cancellation_point();
|
||||
if (requeue)
|
||||
{
|
||||
hydra->processor->queue_job(hydra->processor,
|
||||
&this->public.job_interface);
|
||||
lib->processor->queue_job(lib->processor,
|
||||
&this->public.job_interface);
|
||||
}
|
||||
thread_cleanup_pop(cleanup);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
#include "scheduler.h"
|
||||
|
||||
#include <hydra.h>
|
||||
#include <debug.h>
|
||||
#include <processing/processor.h>
|
||||
#include <processing/jobs/callback_job.h>
|
||||
@@ -200,7 +199,7 @@ static job_requeue_t schedule(private_scheduler_t * this)
|
||||
remove_event(this);
|
||||
this->mutex->unlock(this->mutex);
|
||||
DBG2(DBG_JOB, "got event, queuing job for execution");
|
||||
hydra->processor->queue_job(hydra->processor, event->job);
|
||||
lib->processor->queue_job(lib->processor, event->job);
|
||||
free(event);
|
||||
return JOB_REQUEUE_DIRECT;
|
||||
}
|
||||
@@ -352,7 +351,7 @@ scheduler_t * scheduler_create()
|
||||
this->condvar = condvar_create(CONDVAR_TYPE_DEFAULT);
|
||||
|
||||
this->job = callback_job_create((callback_job_cb_t)schedule, this, NULL, NULL);
|
||||
hydra->processor->queue_job(hydra->processor, (job_t*)this->job);
|
||||
lib->processor->queue_job(lib->processor, (job_t*)this->job);
|
||||
|
||||
return &this->public;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user