Corrected typo on product_file table
[strongswan.git] / src / libimcv / plugins / imc_test / imc_test_state.c
index ade1fc1..cc7e18a 100644 (file)
@@ -44,6 +44,11 @@ struct private_imc_test_state_t {
        char *command;
 
        /**
+        * Is it the first handshake?
+        */
+       bool first_handshake;
+
+       /**
         * Do a handshake retry
         */
        bool handshake_retry;
@@ -84,6 +89,17 @@ METHOD(imc_test_state_t, set_command, void,
        free(old_command);
 }
 
+METHOD(imc_test_state_t, is_first_handshake, bool,
+       private_imc_test_state_t *this)
+{
+       bool first;
+
+       /* test and reset first_handshake flag */
+       first= this->first_handshake;
+       this->first_handshake = FALSE;
+       return first;
+}
+
 METHOD(imc_test_state_t, do_handshake_retry, bool,
        private_imc_test_state_t *this)
 {
@@ -95,7 +111,6 @@ METHOD(imc_test_state_t, do_handshake_retry, bool,
        return retry;
 }
 
-
 /**
  * Described in header.
  */
@@ -113,11 +128,13 @@ imc_state_t *imc_test_state_create(TNC_ConnectionID connection_id,
                        },
                        .get_command = _get_command,
                        .set_command = _set_command,
+                       .is_first_handshake = _is_first_handshake,
                        .do_handshake_retry = _do_handshake_retry,
                },
                .state = TNC_CONNECTION_STATE_CREATE,
                .connection_id = connection_id,
                .command = strdup(command),
+               .first_handshake = TRUE,
                .handshake_retry = retry,
        );