Refer to scheduler and processor via lib and not hydra.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user