IKEv1 XAuth: Added new "swap_initiator" method to the standard task_t interface....
[strongswan.git] / src / libcharon / sa / tasks / task.h
index 4468f2e..eebfb7a 100644 (file)
@@ -34,41 +34,47 @@ 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 */
+       TASK_MAIN_MODE,
+       /** IKEv1 quick mode */
+       TASK_QUICK_MODE,
+       /** Request the user/pass with XAUTH */
+       TASK_XAUTH_REQUEST,
 };
 
 /**
@@ -89,7 +95,7 @@ extern enum_name_t *task_type_names;
  * A responder does the opposite; it calls process() first to handle an incoming
  * request and secondly calls build() to build an appropriate response.
  * Both methods return either SUCCESS, NEED_MORE or FAILED. A SUCCESS indicates
- * that the task completed, even when the task completed unsuccesfully. The
+ * that the task completed, even when the task completed unsuccessfully. The
  * manager then removes the task from the list. A NEED_MORE is returned when
  * the task needs further build()/process() calls to complete, the manager
  * leaves the taks in the queue. A returned FAILED indicates a critical failure.
@@ -102,7 +108,7 @@ struct task_t {
         *
         * @param message               message to add payloads to
         * @return
-        *                                              - FAILED if a critical error occured
+        *                                              - FAILED if a critical error occurred
         *                                              - DESTROY_ME if IKE_SA has been properly deleted
         *                                              - NEED_MORE if another call to build/process needed
         *                                              - SUCCESS if task completed
@@ -114,7 +120,7 @@ struct task_t {
         *
         * @param message               message to read payloads from
         * @return
-        *                                              - FAILED if a critical error occured
+        *                                              - FAILED if a critical error occurred
         *                                              - DESTROY_ME if IKE_SA has been properly deleted
         *                                              - NEED_MORE if another call to build/process needed
         *                                              - SUCCESS if task completed
@@ -145,6 +151,11 @@ struct task_t {
         * Destroys a task_t object.
         */
        void (*destroy) (task_t *this);
+
+       /**
+        * Swaps the initiator flag in a task (if applicable, NULL OK)
+        */
+       void (*swap_initiator) (task_t *this);
 };
 
 #endif /** TASK_H_ @}*/