refactoring of change_state()
[strongswan.git] / src / libimcv / imc / imc_agent.h
index 7c7ef73..1912a39 100644 (file)
@@ -22,6 +22,7 @@
 #define IMC_AGENT_H_
 
 #include "imc_state.h"
+#include "pa_tnc/pa_tnc_msg.h"
 
 #include <tncifimc.h>
 #include <pen/pen.h>
@@ -78,11 +79,13 @@ struct imc_agent_t {
         *
         * @param connection_id         network connection ID assigned by TNCS
         * @param new_state                     new state of TNCCS connection
+        * @param state_p                       internal IMC state instance [optional argument]
         * @return                                      TNC result code
         */
        TNC_Result (*change_state)(imc_agent_t *this,
                                                           TNC_ConnectionID connection_id,
-                                                          TNC_ConnectionState new_state);
+                                                          TNC_ConnectionState new_state,
+                                                          imc_state_t **state_p);
 
        /**
         * Get the IMC state for a TNCCS connection instance
@@ -95,7 +98,7 @@ struct imc_agent_t {
                                          TNC_ConnectionID connection_id, imc_state_t **state);
 
        /**
-        * Call when an IMC-IMV message is to be sent
+        * Call when an PA-TNC message is to be sent
         *
         * @param connection_id         network connection ID assigned by TNCC
         * @param msg                           message to send
@@ -106,6 +109,20 @@ struct imc_agent_t {
                                                           chunk_t msg);
 
        /**
+        * Call when a PA-TNC message was received
+        *
+        * @param connection_id         network connection ID assigned by TNCC
+        * @param msg                           received unparsed message
+        * @param msg_type                      message type of the received message
+        * @param pa_tnc_message        parsed PA-TNC message or NULL if an error occurred
+        * @return                                      TNC result code
+        */
+       TNC_Result (*receive_message)(imc_agent_t *this,
+                                                                 TNC_ConnectionID connection_id, chunk_t msg,
+                                                                 TNC_MessageType msg_type,
+                                                                 pa_tnc_msg_t **pa_tnc_msg);
+
+       /**
         * Destroys an imc_agent_t object
         */
        void (*destroy)(imc_agent_t *this);