android: Implement get_contracts() method in IMC state object

This commit is contained in:
Tobias Brunner
2014-10-14 10:37:55 +02:00
parent f4e6f89aa9
commit 3307de1f8d
@@ -62,6 +62,11 @@ struct private_imc_android_state_t {
*/ */
u_int32_t max_msg_len; u_int32_t max_msg_len;
/**
* PA-TNC attribute segmentation contracts associated with TNCCS connection
*/
seg_contract_manager_t *contracts;
/** /**
* TCG Platform Trust Service (PTS) * TCG Platform Trust Service (PTS)
*/ */
@@ -105,6 +110,12 @@ METHOD(imc_state_t, get_max_msg_len, u_int32_t,
return this->max_msg_len; return this->max_msg_len;
} }
METHOD(imc_state_t, get_contracts, seg_contract_manager_t*,
private_imc_android_state_t *this)
{
return this->contracts;
}
METHOD(imc_state_t, change_state, void, METHOD(imc_state_t, change_state, void,
private_imc_android_state_t *this, TNC_ConnectionState new_state) private_imc_android_state_t *this, TNC_ConnectionState new_state)
{ {
@@ -130,6 +141,7 @@ METHOD(imc_state_t, get_result, bool,
METHOD(imc_state_t, destroy, void, METHOD(imc_state_t, destroy, void,
private_imc_android_state_t *this) private_imc_android_state_t *this)
{ {
this->contracts->destroy(this->contracts);
this->pts->destroy(this->pts); this->pts->destroy(this->pts);
free(this); free(this);
} }
@@ -156,6 +168,7 @@ imc_state_t *imc_android_state_create(TNC_ConnectionID connection_id)
.set_flags = _set_flags, .set_flags = _set_flags,
.set_max_msg_len = _set_max_msg_len, .set_max_msg_len = _set_max_msg_len,
.get_max_msg_len = _get_max_msg_len, .get_max_msg_len = _get_max_msg_len,
.get_contracts = _get_contracts,
.change_state = _change_state, .change_state = _change_state,
.set_result = _set_result, .set_result = _set_result,
.get_result = _get_result, .get_result = _get_result,
@@ -166,6 +179,7 @@ imc_state_t *imc_android_state_create(TNC_ConnectionID connection_id)
.state = TNC_CONNECTION_STATE_CREATE, .state = TNC_CONNECTION_STATE_CREATE,
.result = TNC_IMV_EVALUATION_RESULT_DONT_KNOW, .result = TNC_IMV_EVALUATION_RESULT_DONT_KNOW,
.connection_id = connection_id, .connection_id = connection_id,
.contracts = seg_contract_manager_create(),
.pts = pts_create(TRUE), .pts = pts_create(TRUE),
); );