Replaced DH_NONCE state with TPM_INIT state
[strongswan.git] / src / libimcv / plugins / imv_attestation / imv_attestation_state.h
index 2e83e82..45d382b 100644 (file)
@@ -23,7 +23,7 @@
 #define IMV_ATTESTATION_STATE_H_
 
 #include <imv/imv_state.h>
-#include <tcg/pts/pts.h>
+#include <pts/pts.h>
 #include <library.h>
 
 typedef struct imv_attestation_state_t imv_attestation_state_t;
@@ -34,9 +34,9 @@ typedef enum imv_attestation_handshake_state_t imv_attestation_handshake_state_t
  */
 enum imv_attestation_handshake_state_t {
        IMV_ATTESTATION_STATE_INIT,
+       IMV_ATTESTATION_STATE_TPM_INIT,
        IMV_ATTESTATION_STATE_MEAS,
        IMV_ATTESTATION_STATE_COMP_EVID,
-       IMV_ATTESTATION_STATE_IML,
        IMV_ATTESTATION_STATE_END,
 };
 
@@ -72,6 +72,34 @@ struct imv_attestation_state_t {
         */
        pts_t* (*get_pts)(imv_attestation_state_t *this);
 
+       /**
+        * Add an entry to the list of pending file/directory measurement requests
+        *
+        * @param file_id                       primary key into file table
+        * @param is_dir                        TRUE if directory
+        * @return                                      unique request ID
+        */
+       u_int16_t (*add_request)(imv_attestation_state_t *this, int file_id,
+                                                        bool is_dir);
+
+       /**
+        * Returns the number of pending file/directory measurement requests
+        *
+        * @return                                      number of pending requests
+        */
+       int (*get_request_count)(imv_attestation_state_t *this);
+
+       /**
+        * Check for presence of request_id and if found remove it from the list
+        *
+        * @param id                            unique request ID
+        * @param file_id                       primary key into file table
+        * @param is_dir                        return TRUE if request was for a directory
+        * @return                                      TRUE if request ID found, FALSE otherwise
+        */
+       bool (*check_off_request)(imv_attestation_state_t *this, u_int16_t id,
+                                                         int *file_id, bool *is_dir);
+
 };
 
 /**