]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
task: Add optional pre_process() method
authorTobias Brunner <tobias@strongswan.org>
Thu, 21 May 2015 12:38:02 +0000 (14:38 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 4 Mar 2016 15:03:00 +0000 (16:03 +0100)
This will eventually allow tasks to pre-process and verify received
messages.

src/libcharon/sa/task.h

index ae426076228ffcf855528ff1f31d9d713c249489..b2e9d8886ef8df71e3336f766faa0654bd4d0253 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007 Tobias Brunner
+ * Copyright (C) 2007-2015 Tobias Brunner
  * Copyright (C) 2006 Martin Willi
  * Hochschule fuer Technik Rapperswil
  *
@@ -155,6 +155,18 @@ struct task_t {
         */
        status_t (*process) (task_t *this, message_t *message);
 
+       /**
+        * Verify a message before processing it (optional to implement by tasks).
+        *
+        * @param message               message to verify
+        * @return
+        *                                              - FAILED if verification is not successful, the
+        *                                                message will be silently discarded
+        *                                              - DESTROY_ME if IKE_SA has to be destroyed
+        *                                              - SUCCESS if verification is successful
+        */
+       status_t (*pre_process) (task_t *this, message_t *message);
+
        /**
         * Get the type of the task implementation.
         */