2 * Copyright (C) 2010 Andreas Steffen
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
18 * @{ @ingroup libcharon
24 #include <tnc/tncifimv.h>
27 typedef struct imv_t imv_t
;
30 * Controls a single Integrity Measurement Verifier (IMV)
35 * The TNC Server calls this function to initialize the IMV and agree on
36 * the API version number to be used. It also supplies the IMV ID, an IMV
37 * identifier that the IMV must use when calling TNC Server callback functions.
39 * @param imvID IMV ID assigned by TNCS
40 * @param minVersion minimum API version supported
41 * @param maxVersion maximum API version supported by TNCS
42 * @param OutActualVersion mutually supported API version number
43 * @return TNC result code
45 TNC_Result (*initialize
)(TNC_IMVID imvID
,
46 TNC_Version minVersion
,
47 TNC_Version maxVersion
,
48 TNC_Version
*OutActualVersion
);
51 * The TNC Server calls this function to inform the IMV that the state of
52 * the network connection identified by connectionID has changed to newState.
54 * @param imvID IMV ID assigned by TNCS
55 * @param connectionID network connection ID assigned by TNCS
56 * @param newState new network connection state
57 * @return TNC result code
59 TNC_Result (*notify_connection_change
)(TNC_IMVID imvID
,
60 TNC_ConnectionID connectionID
,
61 TNC_ConnectionState newState
);
64 * The TNC Server calls this function at the end of an Integrity Check
65 * Handshake (after all IMC-IMV messages have been delivered) to solicit
66 * recommendations from IMVs that have not yet provided a recommendation.
68 * @param imvID IMV ID assigned by TNCS
69 * @param connectionID network connection ID assigned by TNCS
70 * @return TNC result code
72 TNC_Result (*solicit_recommendation
)(TNC_IMVID imvID
,
73 TNC_ConnectionID connectionID
);
76 * The TNC Server calls this function to deliver a message to the IMV.
77 * The message is contained in the buffer referenced by message and contains
78 * the number of octets indicated by messageLength. The type of the message
79 * is indicated by messageType.
81 * @param imvID IMV ID assigned by TNCS
82 * @param connectionID network connection ID assigned by TNCS
83 * @param message reference to buffer containing message
84 * @param messageLength number of octets in message
85 * @param messageType message type of message
86 * @return TNC result code
88 TNC_Result (*receive_message
)(TNC_IMVID imvID
,
89 TNC_ConnectionID connectionID
,
90 TNC_BufferReference message
,
91 TNC_UInt32 messageLength
,
92 TNC_MessageType messageType
);
95 * The TNC Server calls this function to notify IMVs that all IMC messages
96 * received in a batch have been delivered and this is the IMV’s last chance
97 * to send a message in the batch of IMV messages currently being collected.
99 * @param imvID IMV ID assigned by TNCS
100 * @param connectionID network connection ID assigned by TNCS
101 * @return TNC result code
103 TNC_Result (*batch_ending
)(TNC_IMVID imvID
,
104 TNC_ConnectionID connectionID
);
107 * The TNC Server calls this function to close down the IMV.
109 * @param imvID IMV ID assigned by TNCS
110 * @return TNC result code
112 TNC_Result (*terminate
)(TNC_IMVID imvID
);
115 * IMVs implementing the UNIX/Linux Dynamic Linkage platform binding MUST
116 * define this additional function. The TNC Server MUST call the function
117 * immediately after calling TNC_IMV_Initialize to provide a pointer to the
118 * TNCS bind function. The IMV can then use the TNCS bind function to obtain
119 * pointers to any other TNCS functions.
121 * @param imvID IMV ID assigned by TNCS
122 * @param bindFunction pointer to TNC_TNCS_BindFunction
123 * @return TNC result code
125 TNC_Result (*provide_bind_function
)(TNC_IMVID imvID
,
126 TNC_TNCS_BindFunctionPointer bindFunction
);
129 * Sets the ID of an imv_t object.
131 * @param id IMV ID to be assigned
133 void (*set_id
)(imv_t
*this, TNC_IMVID id
);
136 * Returns the ID of an imv_t object.
138 * @return IMV ID assigned by TNCS
140 TNC_IMVID (*get_id
)(imv_t
*this);
143 * Returns the name of an imv_t object.
145 * @return name of IMV
147 char* (*get_name
)(imv_t
*this);
150 * Sets the supported message types of an imv_t object.
152 * @param supported_types list of messages type supported by IMV
153 * @param type_count number of supported message types
155 void (*set_message_types
)(imv_t
*this, TNC_MessageTypeList supported_types
,
156 TNC_UInt32 type_count
);
159 * Check if the IMV supports a given message type.
161 * @param message_type message type
162 * @return TRUE if supported
164 bool (*type_supported
)(imv_t
*this, TNC_MessageType message_type
);
167 * Destroys an imv_t object.
169 void (*destroy
)(imv_t
*this);
172 #endif /** IMV_H_ @}*/