Added a generic TASK_ prefix to all task types
authorMartin Willi <martin@revosec.ch>
Mon, 21 Nov 2011 11:18:24 +0000 (12:18 +0100)
committerMartin Willi <martin@revosec.ch>
Tue, 20 Mar 2012 16:30:45 +0000 (17:30 +0100)
31 files changed:
src/libcharon/sa/ike_sa.c
src/libcharon/sa/task_manager_v1.c
src/libcharon/sa/task_manager_v2.c
src/libcharon/sa/tasks/child_create.c
src/libcharon/sa/tasks/child_create.h
src/libcharon/sa/tasks/child_delete.c
src/libcharon/sa/tasks/child_rekey.c
src/libcharon/sa/tasks/child_rekey.h
src/libcharon/sa/tasks/ike_auth.c
src/libcharon/sa/tasks/ike_auth.h
src/libcharon/sa/tasks/ike_auth_lifetime.c
src/libcharon/sa/tasks/ike_auth_lifetime.h
src/libcharon/sa/tasks/ike_cert_post.c
src/libcharon/sa/tasks/ike_cert_pre.c
src/libcharon/sa/tasks/ike_config.c
src/libcharon/sa/tasks/ike_config.h
src/libcharon/sa/tasks/ike_delete.c
src/libcharon/sa/tasks/ike_dpd.c
src/libcharon/sa/tasks/ike_init.c
src/libcharon/sa/tasks/ike_init.h
src/libcharon/sa/tasks/ike_me.c
src/libcharon/sa/tasks/ike_me.h
src/libcharon/sa/tasks/ike_mobike.c
src/libcharon/sa/tasks/ike_natd.c
src/libcharon/sa/tasks/ike_reauth.c
src/libcharon/sa/tasks/ike_rekey.c
src/libcharon/sa/tasks/ike_rekey.h
src/libcharon/sa/tasks/ike_vendor.c
src/libcharon/sa/tasks/main_mode.c
src/libcharon/sa/tasks/task.c
src/libcharon/sa/tasks/task.h

index 1190188..1f87998 100644 (file)
@@ -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;
index 6cc2d75..c96adaa 100644 (file)
@@ -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:
index 158c04b..6148a81 100644 (file)
@@ -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**)&current))
                {
-                       if (current->get_type(current) == IKE_MOBIKE)
+                       if (current->get_type(current) == TASK_IKE_MOBIKE)
                        {
                                enumerator->destroy(enumerator);
                                task->destroy(task);
index 46382a2..7a89e6f 100644 (file)
@@ -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,
index 5dedeb8..fdec3bb 100644 (file)
@@ -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.
index e730746..c5151ab 100644 (file)
@@ -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*,
index bcdf093..fa916c4 100644 (file)
@@ -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;
 }
index 9b1aea5..3ba4176 100644 (file)
@@ -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
index af2c30f..4a92385 100644 (file)
@@ -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,
index 1329079..c6c0100 100644 (file)
@@ -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
index a57cfd0..31e3bff 100644 (file)
@@ -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,
index 3b129b9..9052f42 100644 (file)
@@ -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_ @}*/
index 94af50e..f2986dc 100644 (file)
@@ -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,
index 1919ed0..0de2efd 100644 (file)
@@ -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,
index 4ef9c56..6623730 100644 (file)
@@ -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,
index 8cef086..d343761 100644 (file)
@@ -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 {
index fc24a6e..29ac872 100644 (file)
@@ -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,
index 106eff8..28ccc2e 100644 (file)
@@ -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;
 }
 
 
index aa514bf..3907567 100644 (file)
@@ -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,
index 4b7f604..6855ac8 100644 (file)
@@ -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
index 8f90efc..333c136 100644 (file)
@@ -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,
index 31285a4..74dd1de 100644 (file)
@@ -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
index da8834c..6719bdd 100644 (file)
@@ -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,
index 6b658f8..3de0ab1 100644 (file)
@@ -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,
index 197849d..38c7a42 100644 (file)
@@ -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,
index c089eda..a0d3460 100644 (file)
@@ -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;
 }
index 1c95507..6a9d59b 100644 (file)
@@ -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);
 
index b3a7ddd..7b3cc6e 100644 (file)
@@ -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,
index 4d0c570..2d9acf6 100644 (file)
@@ -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,
index 2889409..83d0478 100644 (file)
 #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",
index 8d78053..8a81439 100644 (file)
@@ -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,
 };