2 * Copyright (C) 2011 Sansar Choinyambuu
3 * HSR Hochschule fuer Technik Rapperswil
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 #include "imc_attestation_state.h"
20 typedef struct private_imc_attestation_state_t private_imc_attestation_state_t
;
23 * Private data of an imc_attestation_state_t object.
25 struct private_imc_attestation_state_t
{
28 * Public members of imc_attestation_state_t
30 imc_attestation_state_t
public;
35 TNC_ConnectionID connection_id
;
38 * TNCCS connection state
40 TNC_ConnectionState state
;
49 METHOD(imc_state_t
, get_connection_id
, TNC_ConnectionID
,
50 private_imc_attestation_state_t
*this)
52 return this->connection_id
;
55 METHOD(imc_state_t
, change_state
, void,
56 private_imc_attestation_state_t
*this, TNC_ConnectionState new_state
)
58 this->state
= new_state
;
61 METHOD(imc_state_t
, destroy
, void,
62 private_imc_attestation_state_t
*this)
64 this->pts
->destroy(this->pts
);
68 METHOD(imc_attestation_state_t
, get_pts
, pts_t
*,
69 private_imc_attestation_state_t
*this)
75 * Described in header.
77 imc_state_t
*imc_attestation_state_create(TNC_ConnectionID connection_id
)
79 private_imc_attestation_state_t
*this;
84 .get_connection_id
= _get_connection_id
,
85 .change_state
= _change_state
,
90 .connection_id
= connection_id
,
91 .state
= TNC_CONNECTION_STATE_CREATE
,
92 .pts
= pts_create(TRUE
),
95 return &this->public.interface
;