]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
task: Add optional post_build() method
authorTobias Brunner <tobias@strongswan.org>
Thu, 28 Jun 2018 08:44:03 +0000 (10:44 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 14 May 2019 08:53:14 +0000 (10:53 +0200)
This will allow tasks to do some work after the message has been
generated.

src/libcharon/sa/task.h

index 987ac489dda59dac0bc2b3c82a5fb767aefdd7e6..71325d9e3c5c5c7987a462616d77db70d449f7a2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2015 Tobias Brunner
+ * Copyright (C) 2007-2018 Tobias Brunner
  * Copyright (C) 2006 Martin Willi
  * HSR Hochschule fuer Technik Rapperswil
  *
@@ -146,6 +146,18 @@ struct task_t {
         */
        status_t (*build) (task_t *this, message_t *message);
 
+       /**
+        * Called after a message has been built (optional to implement by tasks).
+        *
+        * @param message               generated message, can't be modified anymore
+        * @return
+        *                                              - SUCCESS if task completed
+        *                                              - NEED_MORE if another call to build/process needed
+        *                                              - Anything else will result in the destruction of
+        *                                                the IKE_SA
+        */
+       status_t (*post_build) (task_t *this, message_t *message);
+
        /**
         * Process a request or response message for this task.
         *