summaryrefslogtreecommitdiff
path: root/src/libimcv/imv/imv_state.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libimcv/imv/imv_state.h')
-rw-r--r--src/libimcv/imv/imv_state.h104
1 files changed, 96 insertions, 8 deletions
diff --git a/src/libimcv/imv/imv_state.h b/src/libimcv/imv/imv_state.h
index 9e7a29a9f..791846bb1 100644
--- a/src/libimcv/imv/imv_state.h
+++ b/src/libimcv/imv/imv_state.h
@@ -1,5 +1,6 @@
/*
- * Copyright (C) 2011 Andreas Steffen, HSR Hochschule fuer Technik Rapperswil
+ * Copyright (C) 2011-2013 Andreas Steffen
+ * HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -15,12 +16,14 @@
/**
*
* @defgroup imv_state_t imv_state
- * @{ @ingroup imv_state
+ * @{ @ingroup libimcv_imv
*/
#ifndef IMV_STATE_H_
#define IMV_STATE_H_
+#include "imv_session.h"
+
#include <tncifimv.h>
#include <library.h>
@@ -33,9 +36,9 @@ typedef struct imv_state_t imv_state_t;
struct imv_state_t {
/**
- * Get the TNCS connection ID attached to the state
+ * Get the TNCCS connection ID attached to the state
*
- * @return TNCS connection ID of the state
+ * @return TNCCS connection ID of the state
*/
TNC_ConnectionID (*get_connection_id)(imv_state_t *this);
@@ -63,6 +66,65 @@ struct imv_state_t {
void (*set_flags)(imv_state_t *this, bool has_long, bool has_excl);
/**
+ * Set the maximum size of a PA-TNC message for this TNCCS connection
+ *
+ * @param max_msg_len maximum size of a PA-TNC message
+ */
+ void (*set_max_msg_len)(imv_state_t *this, u_int32_t max_msg_len);
+
+ /**
+ * Get the maximum size of a PA-TNC message for this TNCCS connection
+ *
+ * @return maximum size of a PA-TNC message
+ */
+ u_int32_t (*get_max_msg_len)(imv_state_t *this);
+
+ /**
+ * Set flags for completed actions
+ *
+ * @param flags Flags to be set
+ */
+ void (*set_action_flags)(imv_state_t *this, u_int32_t flags);
+
+ /**
+ * Get flags set for completed actions
+ *
+ * @return Flags set for completed actions
+ */
+ u_int32_t (*get_action_flags)(imv_state_t *this);
+
+ /**
+ * Set Access Requestor ID
+ *
+ * @param id_type Access Requestor TCG Standard ID Type
+ * @param id_value Access Requestor TCG Standard ID Value
+ *
+ */
+ void (*set_ar_id)(imv_state_t *this, u_int32_t id_type, chunk_t id_value);
+
+ /**
+ * Get Access Requestor ID
+ *
+ * @param id_type Access Requestor TCG Standard ID Type
+ * @return Access Requestor TCG Standard ID Value
+ */
+ chunk_t (*get_ar_id)(imv_state_t *this, u_int32_t *id_type);
+
+ /**
+ * Set session associated with TNCCS Connection
+ *
+ * @param session Session associated with TNCCS Connection
+ */
+ void (*set_session)(imv_state_t *this, imv_session_t *session);
+
+ /**
+ * Get session associated with TNCCS Connection
+ *
+ * @return Session associated with TNCCS Connection
+ */
+ imv_session_t* (*get_session)(imv_state_t *this);
+
+ /**
* Change the connection state
*
* @param new_state new connection state
@@ -92,15 +154,41 @@ struct imv_state_t {
TNC_IMV_Evaluation_Result eval);
/**
+ * Update IMV action recommendation and evaluation result
+ *
+ * @param rec IMV action recommendation
+ * @param eval IMV evaluation result
+ *
+ */
+ void (*update_recommendation)(imv_state_t *this,
+ TNC_IMV_Action_Recommendation rec,
+ TNC_IMV_Evaluation_Result eval);
+
+ /**
* Get reason string based on the preferred language
*
- * @param preferred_language preferred language
+ * @param language_enumerator language enumerator
* @param reason_string reason string
- * @param language code language of the returned reason string
+ * @param reason_language language of the returned reason string
* @return TRUE if a reason string was found
*/
- bool (*get_reason_string)(imv_state_t *this, chunk_t preferred_language,
- chunk_t *reason_string, chunk_t *language_code);
+ bool (*get_reason_string)(imv_state_t *this,
+ enumerator_t *language_enumerator,
+ chunk_t *reason_string, char **reason_language);
+
+ /**
+ * Get remediation instructions based on the preferred language
+ *
+ * @param language_enumerator language enumerator
+ * @param string remediation instruction string
+ * @param lang_code language of the remediation instructions
+ * @param uri remediation URI
+ * @return TRUE if remediation instructions were found
+ */
+ bool (*get_remediation_instructions)(imv_state_t *this,
+ enumerator_t *language_enumerator,
+ chunk_t *string, char **lang_code,
+ char **uri);
/**
* Destroys an imv_state_t object