2 * Copyright (C) 2011 Andreas Steffen, HSR Hochschule fuer Technik Rapperswil
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 #include "imc_scanner_state.h"
19 typedef struct private_imc_scanner_state_t private_imc_scanner_state_t
;
22 * Private data of an imc_scanner_state_t object.
24 struct private_imc_scanner_state_t
{
27 * Public members of imc_scanner_state_t
29 imc_scanner_state_t
public;
34 TNC_ConnectionID connection_id
;
37 * TNCCS connection state
39 TNC_ConnectionState state
;
42 * Does the TNCCS connection support long message types?
47 * Does the TNCCS connection support exclusive delivery?
53 METHOD(imc_state_t
, get_connection_id
, TNC_ConnectionID
,
54 private_imc_scanner_state_t
*this)
56 return this->connection_id
;
59 METHOD(imc_state_t
, has_long
, bool,
60 private_imc_scanner_state_t
*this)
62 return this->has_long
;
65 METHOD(imc_state_t
, has_excl
, bool,
66 private_imc_scanner_state_t
*this)
68 return this->has_excl
;
71 METHOD(imc_state_t
, set_flags
, void,
72 private_imc_scanner_state_t
*this, bool has_long
, bool has_excl
)
74 this->has_long
= has_long
;
75 this->has_excl
= has_excl
;
78 METHOD(imc_state_t
, change_state
, void,
79 private_imc_scanner_state_t
*this, TNC_ConnectionState new_state
)
81 this->state
= new_state
;
84 METHOD(imc_state_t
, destroy
, void,
85 private_imc_scanner_state_t
*this)
91 * Described in header.
93 imc_state_t
*imc_scanner_state_create(TNC_ConnectionID connection_id
)
95 private_imc_scanner_state_t
*this;
100 .get_connection_id
= _get_connection_id
,
101 .has_long
= _has_long
,
102 .has_excl
= _has_excl
,
103 .set_flags
= _set_flags
,
104 .change_state
= _change_state
,
108 .state
= TNC_CONNECTION_STATE_CREATE
,
109 .connection_id
= connection_id
,
112 return &this->public.interface
;