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
17 * @defgroup imc_agent_t imc_agent
18 * @{ @ingroup imc_agent
24 #include "imc_state.h"
26 #include <tnc/tncifimc.h>
27 #include <tnc/pen/pen.h>
30 typedef struct imc_agent_t imc_agent_t
;
33 * Core functions of an Integrity Measurement Verifier (IMC)
38 * Ask a TNCC to retry an Integrity Check Handshake
40 * @param imc_id IMC ID assigned by TNCC
41 * @param connection_id network connection ID assigned by TNCC
42 * @param reason IMC retry reason
43 * @return TNC result code
45 TNC_Result (*request_handshake_retry
)(TNC_IMCID imc_id
,
46 TNC_ConnectionID connection_id
,
47 TNC_RetryReason reason
);
52 * @param bind_function function offered by the TNCC
53 * @return TNC result code
55 TNC_Result (*bind_functions
)(imc_agent_t
*this,
56 TNC_TNCC_BindFunctionPointer bind_function
);
59 * Create the IMC state for a TNCCS connection instance
61 * @param state internal IMC state instance
62 * @return TNC result code
64 TNC_Result (*create_state
)(imc_agent_t
*this, imc_state_t
*state
);
67 * Delete the IMC state for a TNCCS connection instance
69 * @param connection_id network connection ID assigned by TNCS
70 * @return TNC result code
72 TNC_Result (*delete_state
)(imc_agent_t
*this,
73 TNC_ConnectionID connection_id
);
76 * Change the current state of a TNCCS connection
78 * @param connection_id network connection ID assigned by TNCS
79 * @param new_state new state of TNCCS connection
80 * @return TNC result code
82 TNC_Result (*change_state
)(imc_agent_t
*this,
83 TNC_ConnectionID connection_id
,
84 TNC_ConnectionState new_state
);
87 * Get the IMC state for a TNCCS connection instance
89 * @param connection_id network connection ID assigned by TNCS
90 * @param state internal IMC state instance
91 * @return TRUE if the state was found
93 bool (*get_state
)(imc_agent_t
*this,
94 TNC_ConnectionID connection_id
, imc_state_t
**state
);
97 * Call when an IMC-IMV message is to be sent
99 * @param connection_id network connection ID assigned by TNCC
100 * @param msg message to send
101 * @return TNC result code
103 TNC_Result (*send_message
)(imc_agent_t
*this,
104 TNC_ConnectionID connection_id
,
108 * Destroys an imc_agent_t object
110 void (*destroy
)(imc_agent_t
*this);
114 * Create an imc_agent_t object
116 * @param name name of the IMC
117 * @param vendor_id vendor ID of the IMC
118 * @param subtype message subtype of the IMC
119 * @param id ID of the IMC as assigned by the TNCS
120 * @param actual_version actual version of the IF-IMC API
123 imc_agent_t
*imc_agent_create(const char *name
,
124 pen_t vendor_id
, u_int32_t subtype
,
125 TNC_IMCID id
, TNC_Version
*actual_version
);
127 #endif /** IMC_AGENT_H_ @}*/