Added a generic TASK_ prefix to all task types
This commit is contained in:
@@ -1715,7 +1715,7 @@ static void requeue_init_tasks(private_ike_sa_t *this)
|
||||
this->task_manager, TASK_QUEUE_QUEUED);
|
||||
while (enumerator->enumerate(enumerator, &task))
|
||||
{
|
||||
if (task->get_type(task) == IKE_INIT)
|
||||
if (task->get_type(task) == TASK_IKE_INIT)
|
||||
{
|
||||
has_init = TRUE;
|
||||
break;
|
||||
|
||||
@@ -210,7 +210,7 @@ METHOD(task_manager_t, initiate, status_t,
|
||||
switch (this->ike_sa->get_state(this->ike_sa))
|
||||
{
|
||||
case IKE_CREATED:
|
||||
if (activate_task(this, MAIN_MODE))
|
||||
if (activate_task(this, TASK_MAIN_MODE))
|
||||
{
|
||||
exchange = ID_PROT;
|
||||
}
|
||||
@@ -234,7 +234,7 @@ METHOD(task_manager_t, initiate, status_t,
|
||||
DBG2(DBG_IKE, " %N task", task_type_names, task->get_type(task));
|
||||
switch (task->get_type(task))
|
||||
{
|
||||
case MAIN_MODE:
|
||||
case TASK_MAIN_MODE:
|
||||
exchange = ID_PROT;
|
||||
break;
|
||||
case TASK_QUICK_MODE:
|
||||
|
||||
@@ -211,7 +211,7 @@ METHOD(task_manager_t, retransmit, status_t,
|
||||
enumerator = this->active_tasks->create_enumerator(this->active_tasks);
|
||||
while (enumerator->enumerate(enumerator, (void*)&task))
|
||||
{
|
||||
if (task->get_type(task) == IKE_MOBIKE)
|
||||
if (task->get_type(task) == TASK_IKE_MOBIKE)
|
||||
{
|
||||
mobike = (ike_mobike_t*)task;
|
||||
if (!mobike->is_probing(mobike))
|
||||
@@ -303,78 +303,78 @@ METHOD(task_manager_t, initiate, status_t,
|
||||
switch (this->ike_sa->get_state(this->ike_sa))
|
||||
{
|
||||
case IKE_CREATED:
|
||||
activate_task(this, IKE_VENDOR);
|
||||
if (activate_task(this, IKE_INIT))
|
||||
activate_task(this, TASK_IKE_VENDOR);
|
||||
if (activate_task(this, TASK_IKE_INIT))
|
||||
{
|
||||
this->initiating.mid = 0;
|
||||
exchange = IKE_SA_INIT;
|
||||
activate_task(this, IKE_NATD);
|
||||
activate_task(this, IKE_CERT_PRE);
|
||||
activate_task(this, TASK_IKE_NATD);
|
||||
activate_task(this, TASK_IKE_CERT_PRE);
|
||||
#ifdef ME
|
||||
/* this task has to be activated before the IKE_AUTHENTICATE
|
||||
/* this task has to be activated before the TASK_IKE_AUTH
|
||||
* task, because that task pregenerates the packet after
|
||||
* which no payloads can be added to the message anymore.
|
||||
*/
|
||||
activate_task(this, IKE_ME);
|
||||
activate_task(this, TASK_IKE_ME);
|
||||
#endif /* ME */
|
||||
activate_task(this, IKE_AUTHENTICATE);
|
||||
activate_task(this, IKE_CERT_POST);
|
||||
activate_task(this, IKE_CONFIG);
|
||||
activate_task(this, CHILD_CREATE);
|
||||
activate_task(this, IKE_AUTH_LIFETIME);
|
||||
activate_task(this, IKE_MOBIKE);
|
||||
activate_task(this, TASK_IKE_AUTH);
|
||||
activate_task(this, TASK_IKE_CERT_POST);
|
||||
activate_task(this, TASK_IKE_CONFIG);
|
||||
activate_task(this, TASK_CHILD_CREATE);
|
||||
activate_task(this, TASK_IKE_AUTH_LIFETIME);
|
||||
activate_task(this, TASK_IKE_MOBIKE);
|
||||
}
|
||||
break;
|
||||
case IKE_ESTABLISHED:
|
||||
if (activate_task(this, CHILD_CREATE))
|
||||
if (activate_task(this, TASK_CHILD_CREATE))
|
||||
{
|
||||
exchange = CREATE_CHILD_SA;
|
||||
break;
|
||||
}
|
||||
if (activate_task(this, CHILD_DELETE))
|
||||
if (activate_task(this, TASK_CHILD_DELETE))
|
||||
{
|
||||
exchange = INFORMATIONAL;
|
||||
break;
|
||||
}
|
||||
if (activate_task(this, CHILD_REKEY))
|
||||
if (activate_task(this, TASK_CHILD_REKEY))
|
||||
{
|
||||
exchange = CREATE_CHILD_SA;
|
||||
break;
|
||||
}
|
||||
if (activate_task(this, IKE_DELETE))
|
||||
if (activate_task(this, TASK_IKE_DELETE))
|
||||
{
|
||||
exchange = INFORMATIONAL;
|
||||
break;
|
||||
}
|
||||
if (activate_task(this, IKE_REKEY))
|
||||
if (activate_task(this, TASK_IKE_REKEY))
|
||||
{
|
||||
exchange = CREATE_CHILD_SA;
|
||||
break;
|
||||
}
|
||||
if (activate_task(this, IKE_REAUTH))
|
||||
if (activate_task(this, TASK_IKE_REAUTH))
|
||||
{
|
||||
exchange = INFORMATIONAL;
|
||||
break;
|
||||
}
|
||||
if (activate_task(this, IKE_MOBIKE))
|
||||
if (activate_task(this, TASK_IKE_MOBIKE))
|
||||
{
|
||||
exchange = INFORMATIONAL;
|
||||
break;
|
||||
}
|
||||
if (activate_task(this, IKE_DPD))
|
||||
if (activate_task(this, TASK_IKE_DPD))
|
||||
{
|
||||
exchange = INFORMATIONAL;
|
||||
break;
|
||||
}
|
||||
#ifdef ME
|
||||
if (activate_task(this, IKE_ME))
|
||||
if (activate_task(this, TASK_IKE_ME))
|
||||
{
|
||||
exchange = ME_CONNECT;
|
||||
break;
|
||||
}
|
||||
#endif /* ME */
|
||||
case IKE_REKEYING:
|
||||
if (activate_task(this, IKE_DELETE))
|
||||
if (activate_task(this, TASK_IKE_DELETE))
|
||||
{
|
||||
exchange = INFORMATIONAL;
|
||||
break;
|
||||
@@ -393,18 +393,18 @@ METHOD(task_manager_t, initiate, status_t,
|
||||
DBG2(DBG_IKE, " %N task", task_type_names, task->get_type(task));
|
||||
switch (task->get_type(task))
|
||||
{
|
||||
case IKE_INIT:
|
||||
case TASK_IKE_INIT:
|
||||
exchange = IKE_SA_INIT;
|
||||
break;
|
||||
case IKE_AUTHENTICATE:
|
||||
case TASK_IKE_AUTH:
|
||||
exchange = IKE_AUTH;
|
||||
break;
|
||||
case CHILD_CREATE:
|
||||
case CHILD_REKEY:
|
||||
case IKE_REKEY:
|
||||
case TASK_CHILD_CREATE:
|
||||
case TASK_CHILD_REKEY:
|
||||
case TASK_IKE_REKEY:
|
||||
exchange = CREATE_CHILD_SA;
|
||||
break;
|
||||
case IKE_MOBIKE:
|
||||
case TASK_IKE_MOBIKE:
|
||||
exchange = INFORMATIONAL;
|
||||
break;
|
||||
default:
|
||||
@@ -555,8 +555,9 @@ static bool handle_collisions(private_task_manager_t *this, task_t *task)
|
||||
type = task->get_type(task);
|
||||
|
||||
/* do we have to check */
|
||||
if (type == IKE_REKEY || type == CHILD_REKEY ||
|
||||
type == CHILD_DELETE || type == IKE_DELETE || type == IKE_REAUTH)
|
||||
if (type == TASK_IKE_REKEY || type == TASK_CHILD_REKEY ||
|
||||
type == TASK_CHILD_DELETE || type == TASK_IKE_DELETE ||
|
||||
type == TASK_IKE_REAUTH)
|
||||
{
|
||||
/* find an exchange collision, and notify these tasks */
|
||||
enumerator = this->active_tasks->create_enumerator(this->active_tasks);
|
||||
@@ -564,17 +565,17 @@ static bool handle_collisions(private_task_manager_t *this, task_t *task)
|
||||
{
|
||||
switch (active->get_type(active))
|
||||
{
|
||||
case IKE_REKEY:
|
||||
if (type == IKE_REKEY || type == IKE_DELETE ||
|
||||
type == IKE_REAUTH)
|
||||
case TASK_IKE_REKEY:
|
||||
if (type == TASK_IKE_REKEY || type == TASK_IKE_DELETE ||
|
||||
type == TASK_IKE_REAUTH)
|
||||
{
|
||||
ike_rekey_t *rekey = (ike_rekey_t*)active;
|
||||
rekey->collide(rekey, task);
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
case CHILD_REKEY:
|
||||
if (type == CHILD_REKEY || type == CHILD_DELETE)
|
||||
case TASK_CHILD_REKEY:
|
||||
if (type == TASK_CHILD_REKEY || type == TASK_CHILD_DELETE)
|
||||
{
|
||||
child_rekey_t *rekey = (child_rekey_t*)active;
|
||||
rekey->collide(rekey, task);
|
||||
@@ -977,7 +978,7 @@ METHOD(task_manager_t, process_message, status_t,
|
||||
METHOD(task_manager_t, queue_task, void,
|
||||
private_task_manager_t *this, task_t *task)
|
||||
{
|
||||
if (task->get_type(task) == IKE_MOBIKE)
|
||||
if (task->get_type(task) == TASK_IKE_MOBIKE)
|
||||
{ /* there is no need to queue more than one mobike task */
|
||||
enumerator_t *enumerator;
|
||||
task_t *current;
|
||||
@@ -985,7 +986,7 @@ METHOD(task_manager_t, queue_task, void,
|
||||
enumerator = this->queued_tasks->create_enumerator(this->queued_tasks);
|
||||
while (enumerator->enumerate(enumerator, (void**)¤t))
|
||||
{
|
||||
if (current->get_type(current) == IKE_MOBIKE)
|
||||
if (current->get_type(current) == TASK_IKE_MOBIKE)
|
||||
{
|
||||
enumerator->destroy(enumerator);
|
||||
task->destroy(task);
|
||||
|
||||
@@ -1212,7 +1212,7 @@ METHOD(child_create_t, get_lower_nonce, chunk_t,
|
||||
METHOD(task_t, get_type, task_type_t,
|
||||
private_child_create_t *this)
|
||||
{
|
||||
return CHILD_CREATE;
|
||||
return TASK_CHILD_CREATE;
|
||||
}
|
||||
|
||||
METHOD(task_t, migrate, void,
|
||||
|
||||
@@ -29,7 +29,7 @@ typedef struct child_create_t child_create_t;
|
||||
#include <config/child_cfg.h>
|
||||
|
||||
/**
|
||||
* Task of type CHILD_CREATE, established a new CHILD_SA.
|
||||
* Task of type TASK_CHILD_CREATE, established a new CHILD_SA.
|
||||
*
|
||||
* This task may be included in the IKE_AUTH message or in a separate
|
||||
* CREATE_CHILD_SA exchange.
|
||||
|
||||
@@ -324,7 +324,7 @@ METHOD(task_t, build_r, status_t,
|
||||
METHOD(task_t, get_type, task_type_t,
|
||||
private_child_delete_t *this)
|
||||
{
|
||||
return CHILD_DELETE;
|
||||
return TASK_CHILD_DELETE;
|
||||
}
|
||||
|
||||
METHOD(child_delete_t , get_child, child_sa_t*,
|
||||
|
||||
@@ -224,7 +224,7 @@ static child_sa_t *handle_collision(private_child_rekey_t *this)
|
||||
{
|
||||
child_sa_t *to_delete;
|
||||
|
||||
if (this->collision->get_type(this->collision) == CHILD_REKEY)
|
||||
if (this->collision->get_type(this->collision) == TASK_CHILD_REKEY)
|
||||
{
|
||||
chunk_t this_nonce, other_nonce;
|
||||
private_child_rekey_t *other = (private_child_rekey_t*)this->collision;
|
||||
@@ -311,7 +311,7 @@ METHOD(task_t, process_i, status_t,
|
||||
/* establishing new child failed, reuse old. but not when we
|
||||
* received a delete in the meantime */
|
||||
if (!(this->collision &&
|
||||
this->collision->get_type(this->collision) == CHILD_DELETE))
|
||||
this->collision->get_type(this->collision) == TASK_CHILD_DELETE))
|
||||
{
|
||||
job_t *job;
|
||||
u_int32_t retry = RETRY_INTERVAL - (random() % RETRY_JITTER);
|
||||
@@ -362,7 +362,7 @@ METHOD(task_t, process_i, status_t,
|
||||
METHOD(task_t, get_type, task_type_t,
|
||||
private_child_rekey_t *this)
|
||||
{
|
||||
return CHILD_REKEY;
|
||||
return TASK_CHILD_REKEY;
|
||||
}
|
||||
|
||||
METHOD(child_rekey_t, collide, void,
|
||||
@@ -370,7 +370,7 @@ METHOD(child_rekey_t, collide, void,
|
||||
{
|
||||
/* the task manager only detects exchange collision, but not if
|
||||
* the collision is for the same child. we check it here. */
|
||||
if (other->get_type(other) == CHILD_REKEY)
|
||||
if (other->get_type(other) == TASK_CHILD_REKEY)
|
||||
{
|
||||
private_child_rekey_t *rekey = (private_child_rekey_t*)other;
|
||||
if (rekey->child_sa != this->child_sa)
|
||||
@@ -380,7 +380,7 @@ METHOD(child_rekey_t, collide, void,
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (other->get_type(other) == CHILD_DELETE)
|
||||
else if (other->get_type(other) == TASK_CHILD_DELETE)
|
||||
{
|
||||
child_delete_t *del = (child_delete_t*)other;
|
||||
if (del->get_child(del) == this->child_create->get_child(this->child_create))
|
||||
@@ -403,8 +403,8 @@ METHOD(child_rekey_t, collide, void,
|
||||
other->destroy(other);
|
||||
return;
|
||||
}
|
||||
DBG1(DBG_IKE, "detected %N collision with %N", task_type_names, CHILD_REKEY,
|
||||
task_type_names, other->get_type(other));
|
||||
DBG1(DBG_IKE, "detected %N collision with %N", task_type_names,
|
||||
TASK_CHILD_REKEY, task_type_names, other->get_type(other));
|
||||
DESTROY_IF(this->collision);
|
||||
this->collision = other;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ typedef struct child_rekey_t child_rekey_t;
|
||||
#include <sa/tasks/task.h>
|
||||
|
||||
/**
|
||||
* Task of type CHILD_REKEY, rekey an established CHILD_SA.
|
||||
* Task of type TASK_CHILD_REKEY, rekey an established CHILD_SA.
|
||||
*/
|
||||
struct child_rekey_t {
|
||||
|
||||
@@ -51,7 +51,7 @@ struct child_rekey_t {
|
||||
};
|
||||
|
||||
/**
|
||||
* Create a new CHILD_REKEY task.
|
||||
* Create a new TASK_CHILD_REKEY task.
|
||||
*
|
||||
* @param ike_sa IKE_SA this task works for
|
||||
* @param protocol protocol of CHILD_SA to rekey, PROTO_NONE as responder
|
||||
|
||||
@@ -1023,7 +1023,7 @@ peer_auth_failed:
|
||||
METHOD(task_t, get_type, task_type_t,
|
||||
private_ike_auth_t *this)
|
||||
{
|
||||
return IKE_AUTHENTICATE;
|
||||
return TASK_IKE_AUTH;
|
||||
}
|
||||
|
||||
METHOD(task_t, migrate, void,
|
||||
|
||||
@@ -46,7 +46,7 @@ struct ike_auth_t {
|
||||
};
|
||||
|
||||
/**
|
||||
* Create a new task of type IKE_AUTHENTICATE.
|
||||
* Create a new task of type TASK_IKE_AUTH.
|
||||
*
|
||||
* @param ike_sa IKE_SA this task works for
|
||||
* @param initiator TRUE if task is the initiator of an exchange
|
||||
|
||||
@@ -124,7 +124,7 @@ METHOD(task_t, process_i, status_t,
|
||||
METHOD(task_t, get_type, task_type_t,
|
||||
private_ike_auth_lifetime_t *this)
|
||||
{
|
||||
return IKE_AUTH_LIFETIME;
|
||||
return TASK_IKE_AUTH_LIFETIME;
|
||||
}
|
||||
|
||||
METHOD(task_t, migrate, void,
|
||||
|
||||
@@ -28,7 +28,7 @@ typedef struct ike_auth_lifetime_t ike_auth_lifetime_t;
|
||||
#include <sa/tasks/task.h>
|
||||
|
||||
/**
|
||||
* Task of type IKE_AUTH_LIFETIME, implements RFC4478.
|
||||
* Task of type TASK_IKE_AUTH_LIFETIME, implements RFC4478.
|
||||
*
|
||||
* This task exchanges lifetimes for IKE_AUTH to force a client to
|
||||
* reauthenticate before the responders lifetime reaches the limit.
|
||||
@@ -42,7 +42,7 @@ struct ike_auth_lifetime_t {
|
||||
};
|
||||
|
||||
/**
|
||||
* Create a new IKE_AUTH_LIFETIME task.
|
||||
* Create a new TASK_IKE_AUTH_LIFETIME task.
|
||||
*
|
||||
* @param ike_sa IKE_SA this task works for
|
||||
* @param initiator TRUE if taks is initiated by us
|
||||
@@ -50,4 +50,4 @@ struct ike_auth_lifetime_t {
|
||||
*/
|
||||
ike_auth_lifetime_t *ike_auth_lifetime_create(ike_sa_t *ike_sa, bool initiator);
|
||||
|
||||
#endif /** IKE_MOBIKE_H_ @}*/
|
||||
#endif /** IKE_AUTH_LIFETIME_H_ @}*/
|
||||
|
||||
@@ -207,7 +207,7 @@ METHOD(task_t, process_i, status_t,
|
||||
METHOD(task_t, get_type, task_type_t,
|
||||
private_ike_cert_post_t *this)
|
||||
{
|
||||
return IKE_CERT_POST;
|
||||
return TASK_IKE_CERT_POST;
|
||||
}
|
||||
|
||||
METHOD(task_t, migrate, void,
|
||||
|
||||
@@ -479,7 +479,7 @@ METHOD(task_t, process_i, status_t,
|
||||
METHOD(task_t, get_type, task_type_t,
|
||||
private_ike_cert_pre_t *this)
|
||||
{
|
||||
return IKE_CERT_PRE;
|
||||
return TASK_IKE_CERT_PRE;
|
||||
}
|
||||
|
||||
METHOD(task_t, migrate, void,
|
||||
|
||||
@@ -385,7 +385,7 @@ METHOD(task_t, process_i, status_t,
|
||||
METHOD(task_t, get_type, task_type_t,
|
||||
private_ike_config_t *this)
|
||||
{
|
||||
return IKE_CONFIG;
|
||||
return TASK_IKE_CONFIG;
|
||||
}
|
||||
|
||||
METHOD(task_t, migrate, void,
|
||||
|
||||
@@ -28,7 +28,7 @@ typedef struct ike_config_t ike_config_t;
|
||||
#include <sa/tasks/task.h>
|
||||
|
||||
/**
|
||||
* Task of type IKE_CONFIG, sets up a virtual IP and other
|
||||
* Task of type TASK_IKE_CONFIG, sets up a virtual IP and other
|
||||
* configurations for an IKE_SA.
|
||||
*/
|
||||
struct ike_config_t {
|
||||
|
||||
@@ -149,7 +149,7 @@ METHOD(task_t, build_r, status_t,
|
||||
METHOD(task_t, get_type, task_type_t,
|
||||
private_ike_delete_t *this)
|
||||
{
|
||||
return IKE_DELETE;
|
||||
return TASK_IKE_DELETE;
|
||||
}
|
||||
|
||||
METHOD(task_t, migrate, void,
|
||||
|
||||
@@ -46,7 +46,7 @@ METHOD(task_t, return_success, status_t,
|
||||
METHOD(task_t, get_type, task_type_t,
|
||||
private_ike_dpd_t *this)
|
||||
{
|
||||
return IKE_DPD;
|
||||
return TASK_IKE_DPD;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -507,7 +507,7 @@ METHOD(task_t, process_i, status_t,
|
||||
METHOD(task_t, get_type, task_type_t,
|
||||
private_ike_init_t *this)
|
||||
{
|
||||
return IKE_INIT;
|
||||
return TASK_IKE_INIT;
|
||||
}
|
||||
|
||||
METHOD(task_t, migrate, void,
|
||||
|
||||
@@ -28,7 +28,7 @@ typedef struct ike_init_t ike_init_t;
|
||||
#include <sa/tasks/task.h>
|
||||
|
||||
/**
|
||||
* Task of type IKE_INIT, creates an IKE_SA without authentication.
|
||||
* Task of type TASK_IKE_INIT, creates an IKE_SA without authentication.
|
||||
*
|
||||
* The authentication of is handle in the ike_auth task.
|
||||
*/
|
||||
@@ -48,7 +48,7 @@ struct ike_init_t {
|
||||
};
|
||||
|
||||
/**
|
||||
* Create a new IKE_INIT task.
|
||||
* Create a new TASK_IKE_INIT task.
|
||||
*
|
||||
* @param ike_sa IKE_SA this task works for (new one when rekeying)
|
||||
* @param initiator TRUE if task is the original initiator
|
||||
|
||||
@@ -750,7 +750,7 @@ METHOD(ike_me_t, relay, void,
|
||||
METHOD(task_t, get_type, task_type_t,
|
||||
private_ike_me_t *this)
|
||||
{
|
||||
return IKE_ME;
|
||||
return TASK_IKE_ME;
|
||||
}
|
||||
|
||||
METHOD(task_t, migrate, void,
|
||||
|
||||
@@ -28,7 +28,7 @@ typedef struct ike_me_t ike_me_t;
|
||||
#include <sa/tasks/task.h>
|
||||
|
||||
/**
|
||||
* Task of type IKE_ME, detects and handles IKE-ME extensions.
|
||||
* Task of type TASK_IKE_ME, detects and handles IKE-ME extensions.
|
||||
*
|
||||
* This tasks handles the ME_MEDIATION Notify exchange to setup a mediation
|
||||
* connection, allows to initiate mediated connections using ME_CONNECT
|
||||
|
||||
@@ -53,7 +53,7 @@ struct private_ike_mobike_t {
|
||||
chunk_t cookie2;
|
||||
|
||||
/**
|
||||
* NAT discovery reusing the IKE_NATD task
|
||||
* NAT discovery reusing the TASK_IKE_NATD task
|
||||
*/
|
||||
ike_natd_t *natd;
|
||||
|
||||
@@ -587,7 +587,7 @@ METHOD(ike_mobike_t, is_probing, bool,
|
||||
METHOD(task_t, get_type, task_type_t,
|
||||
private_ike_mobike_t *this)
|
||||
{
|
||||
return IKE_MOBIKE;
|
||||
return TASK_IKE_MOBIKE;
|
||||
}
|
||||
|
||||
METHOD(task_t, migrate, void,
|
||||
|
||||
@@ -385,7 +385,7 @@ METHOD(task_t, process_r, status_t,
|
||||
METHOD(task_t, get_type, task_type_t,
|
||||
private_ike_natd_t *this)
|
||||
{
|
||||
return IKE_NATD;
|
||||
return TASK_IKE_NATD;
|
||||
}
|
||||
|
||||
METHOD(task_t, migrate, void,
|
||||
|
||||
@@ -150,7 +150,7 @@ METHOD(task_t, process_i, status_t,
|
||||
METHOD(task_t, get_type, task_type_t,
|
||||
private_ike_reauth_t *this)
|
||||
{
|
||||
return IKE_REAUTH;
|
||||
return TASK_IKE_REAUTH;
|
||||
}
|
||||
|
||||
METHOD(task_t, migrate, void,
|
||||
|
||||
@@ -52,7 +52,7 @@ struct private_ike_rekey_t {
|
||||
bool initiator;
|
||||
|
||||
/**
|
||||
* the IKE_INIT task which is reused to simplify rekeying
|
||||
* the TASK_IKE_INIT task which is reused to simplify rekeying
|
||||
*/
|
||||
ike_init_t *ike_init;
|
||||
|
||||
@@ -233,8 +233,8 @@ METHOD(task_t, process_i, status_t,
|
||||
case FAILED:
|
||||
/* rekeying failed, fallback to old SA */
|
||||
if (!(this->collision && (
|
||||
this->collision->get_type(this->collision) == IKE_DELETE ||
|
||||
this->collision->get_type(this->collision) == IKE_REAUTH)))
|
||||
this->collision->get_type(this->collision) == TASK_IKE_DELETE ||
|
||||
this->collision->get_type(this->collision) == TASK_IKE_REAUTH)))
|
||||
{
|
||||
job_t *job;
|
||||
u_int32_t retry = RETRY_INTERVAL - (random() % RETRY_JITTER);
|
||||
@@ -256,7 +256,7 @@ METHOD(task_t, process_i, status_t,
|
||||
|
||||
/* check for collisions */
|
||||
if (this->collision &&
|
||||
this->collision->get_type(this->collision) == IKE_REKEY)
|
||||
this->collision->get_type(this->collision) == TASK_IKE_REKEY)
|
||||
{
|
||||
private_ike_rekey_t *other = (private_ike_rekey_t*)this->collision;
|
||||
|
||||
@@ -326,14 +326,14 @@ METHOD(task_t, process_i, status_t,
|
||||
METHOD(task_t, get_type, task_type_t,
|
||||
private_ike_rekey_t *this)
|
||||
{
|
||||
return IKE_REKEY;
|
||||
return TASK_IKE_REKEY;
|
||||
}
|
||||
|
||||
METHOD(ike_rekey_t, collide, void,
|
||||
private_ike_rekey_t* this, task_t *other)
|
||||
{
|
||||
DBG1(DBG_IKE, "detected %N collision with %N", task_type_names, IKE_REKEY,
|
||||
task_type_names, other->get_type(other));
|
||||
DBG1(DBG_IKE, "detected %N collision with %N", task_type_names,
|
||||
TASK_IKE_REKEY, task_type_names, other->get_type(other));
|
||||
DESTROY_IF(this->collision);
|
||||
this->collision = other;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ typedef struct ike_rekey_t ike_rekey_t;
|
||||
#include <sa/tasks/task.h>
|
||||
|
||||
/**
|
||||
* Task of type IKE_REKEY, rekey an established IKE_SA.
|
||||
* Task of type TASK_IKE_REKEY, rekey an established IKE_SA.
|
||||
*/
|
||||
struct ike_rekey_t {
|
||||
|
||||
@@ -50,11 +50,11 @@ struct ike_rekey_t {
|
||||
};
|
||||
|
||||
/**
|
||||
* Create a new IKE_REKEY task.
|
||||
* Create a new TASK_IKE_REKEY task.
|
||||
*
|
||||
* @param ike_sa IKE_SA this task works for
|
||||
* @param initiator TRUE for initiator, FALSE for responder
|
||||
* @return IKE_REKEY task to handle by the task_manager
|
||||
* @return TASK_IKE_REKEY task to handle by the task_manager
|
||||
*/
|
||||
ike_rekey_t *ike_rekey_create(ike_sa_t *ike_sa, bool initiator);
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ METHOD(task_t, migrate, void,
|
||||
METHOD(task_t, get_type, task_type_t,
|
||||
private_ike_vendor_t *this)
|
||||
{
|
||||
return IKE_VENDOR;
|
||||
return TASK_IKE_VENDOR;
|
||||
}
|
||||
|
||||
METHOD(task_t, destroy, void,
|
||||
|
||||
@@ -527,7 +527,7 @@ METHOD(task_t, process_i, status_t,
|
||||
METHOD(task_t, get_type, task_type_t,
|
||||
private_main_mode_t *this)
|
||||
{
|
||||
return MAIN_MODE;
|
||||
return TASK_MAIN_MODE;
|
||||
}
|
||||
|
||||
METHOD(task_t, migrate, void,
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
#include "task.h"
|
||||
|
||||
#ifdef ME
|
||||
ENUM(task_type_names, IKE_INIT, TASK_QUICK_MODE,
|
||||
ENUM(task_type_names, TASK_IKE_INIT, TASK_QUICK_MODE,
|
||||
"IKE_INIT",
|
||||
"IKE_NATD",
|
||||
"IKE_MOBIKE",
|
||||
"IKE_AUTHENTICATE",
|
||||
"IKE_AUTH",
|
||||
"IKE_AUTH_LIFETIME",
|
||||
"IKE_CERT_PRE",
|
||||
"IKE_CERT_POST",
|
||||
@@ -39,11 +39,11 @@ ENUM(task_type_names, IKE_INIT, TASK_QUICK_MODE,
|
||||
"QUICK_MODE",
|
||||
);
|
||||
#else
|
||||
ENUM(task_type_names, IKE_INIT, TASK_QUICK_MODE,
|
||||
ENUM(task_type_names, TASK_IKE_INIT, TASK_QUICK_MODE,
|
||||
"IKE_INIT",
|
||||
"IKE_NATD",
|
||||
"IKE_MOBIKE",
|
||||
"IKE_AUTHENTICATE",
|
||||
"IKE_AUTH",
|
||||
"IKE_AUTH_LIFETIME",
|
||||
"IKE_CERT_PRE",
|
||||
"IKE_CERT_POST",
|
||||
|
||||
@@ -34,43 +34,43 @@ typedef struct task_t task_t;
|
||||
*/
|
||||
enum task_type_t {
|
||||
/** establish an unauthenticated IKE_SA */
|
||||
IKE_INIT,
|
||||
TASK_IKE_INIT,
|
||||
/** detect NAT situation */
|
||||
IKE_NATD,
|
||||
TASK_IKE_NATD,
|
||||
/** handle MOBIKE stuff */
|
||||
IKE_MOBIKE,
|
||||
TASK_IKE_MOBIKE,
|
||||
/** authenticate the initiated IKE_SA */
|
||||
IKE_AUTHENTICATE,
|
||||
TASK_IKE_AUTH,
|
||||
/** AUTH_LIFETIME negotiation, RFC4478 */
|
||||
IKE_AUTH_LIFETIME,
|
||||
TASK_IKE_AUTH_LIFETIME,
|
||||
/** certificate processing before authentication (certreqs, cert parsing) */
|
||||
IKE_CERT_PRE,
|
||||
TASK_IKE_CERT_PRE,
|
||||
/** certificate processing after authentication (certs payload generation) */
|
||||
IKE_CERT_POST,
|
||||
TASK_IKE_CERT_POST,
|
||||
/** Configuration payloads, virtual IP and such */
|
||||
IKE_CONFIG,
|
||||
TASK_IKE_CONFIG,
|
||||
/** rekey an IKE_SA */
|
||||
IKE_REKEY,
|
||||
TASK_IKE_REKEY,
|
||||
/** reestablish a complete IKE_SA */
|
||||
IKE_REAUTH,
|
||||
TASK_IKE_REAUTH,
|
||||
/** delete an IKE_SA */
|
||||
IKE_DELETE,
|
||||
TASK_IKE_DELETE,
|
||||
/** liveness check */
|
||||
IKE_DPD,
|
||||
TASK_IKE_DPD,
|
||||
/** Vendor ID processing */
|
||||
IKE_VENDOR,
|
||||
TASK_IKE_VENDOR,
|
||||
#ifdef ME
|
||||
/** handle ME stuff */
|
||||
IKE_ME,
|
||||
TASK_IKE_ME,
|
||||
#endif /* ME */
|
||||
/** establish a CHILD_SA within an IKE_SA */
|
||||
CHILD_CREATE,
|
||||
TASK_CHILD_CREATE,
|
||||
/** delete an established CHILD_SA */
|
||||
CHILD_DELETE,
|
||||
TASK_CHILD_DELETE,
|
||||
/** rekey an CHILD_SA */
|
||||
CHILD_REKEY,
|
||||
TASK_CHILD_REKEY,
|
||||
/** IKEv1 main mode */
|
||||
MAIN_MODE,
|
||||
TASK_MAIN_MODE,
|
||||
/** IKEv1 quick mode */
|
||||
TASK_QUICK_MODE,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user