defined SUBTYPE_ANY for all known Vendor IDs
[strongswan.git] / src / libtncif / tncifimv.h
1 /* tncifimv.h
2 *
3 * Trusted Network Connect IF-IMV API version 1.30
4 * Microsoft Windows DLL Platform Binding C Header
5 * October 14, 2011
6 *
7 * Copyright(c) 2005-2011, Trusted Computing Group, Inc. All rights
8 * reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * o Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * o Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in
17 * the documentation and/or other materials provided with the
18 * distribution.
19 * o Neither the name of the Trusted Computing Group nor the names of
20 * its contributors may be used to endorse or promote products
21 * derived from this software without specific prior written
22 * permission.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
27 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
28 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
29 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
30 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
34 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE.
36 *
37 * Contact the Trusted Computing Group at
38 * admin@trustedcomputinggroup.org for information on specification
39 * licensing through membership agreements.
40 *
41 * Any marks and brands contained herein are the property of their
42 * respective owners.
43 */
44
45 /**
46 * @defgroup tncifimv tncifimv
47 * @{ @ingroup libtncif
48 */
49
50 #ifndef TNCIFIMV_H_
51 #define TNCIFIMV_H_
52
53 #include "tncif.h"
54
55 #ifdef WIN32
56 #ifdef TNC_IMV_EXPORTS
57 #define TNC_IMV_API __declspec(dllexport)
58 #else
59 #define TNC_IMV_API __declspec(dllimport)
60 #endif
61 #else
62 #define TNC_IMV_API
63 #endif
64
65 /* Derived Types */
66
67 typedef TNC_UInt32 TNC_IMVID;
68 typedef TNC_UInt32 TNC_IMV_Action_Recommendation;
69 typedef TNC_UInt32 TNC_IMV_Evaluation_Result;
70
71 /* Function pointers */
72
73 typedef TNC_Result (*TNC_IMV_InitializePointer)(
74 TNC_IMVID imvID,
75 TNC_Version minVersion,
76 TNC_Version maxVersion,
77 TNC_Version *pOutActualVersion);
78 typedef TNC_Result (*TNC_IMV_NotifyConnectionChangePointer)(
79 TNC_IMVID imvID,
80 TNC_ConnectionID connectionID,
81 TNC_ConnectionState newState);
82 typedef TNC_Result (*TNC_IMV_ReceiveMessagePointer)(
83 TNC_IMVID imvID,
84 TNC_ConnectionID connectionID,
85 TNC_BufferReference message,
86 TNC_UInt32 messageLength,
87 TNC_MessageType messageType);
88 typedef TNC_Result (*TNC_IMV_ReceiveMessageSOHPointer)(
89 TNC_IMVID imvID,
90 TNC_ConnectionID connectionID,
91 TNC_BufferReference sohReportEntry,
92 TNC_UInt32 sohRELength,
93 TNC_MessageType systemHealthID);
94 typedef TNC_Result (*TNC_IMV_ReceiveMessageLongPointer)(
95 TNC_IMVID imvID,
96 TNC_ConnectionID connectionID,
97 TNC_UInt32 messageFlags,
98 TNC_BufferReference message,
99 TNC_UInt32 messageLength,
100 TNC_VendorID messageVendorID,
101 TNC_MessageSubtype messageSubtype,
102 TNC_UInt32 sourceIMCID,
103 TNC_UInt32 destinationIMVID);
104 typedef TNC_Result (*TNC_IMV_SolicitRecommendationPointer)(
105 TNC_IMVID imvID,
106 TNC_ConnectionID connectionID);
107 typedef TNC_Result (*TNC_IMV_BatchEndingPointer)(
108 TNC_IMVID imvID,
109 TNC_ConnectionID connectionID);
110 typedef TNC_Result (*TNC_IMV_TerminatePointer)(
111 TNC_IMVID imvID);
112 typedef TNC_Result (*TNC_TNCS_ReportMessageTypesPointer)(
113 TNC_IMVID imvID,
114 TNC_MessageTypeList supportedTypes,
115 TNC_UInt32 typeCount);
116 typedef TNC_Result (*TNC_TNCS_ReportMessageTypesLongPointer)(
117 TNC_IMVID imvID,
118 TNC_VendorIDList supportedVendorIDs,
119 TNC_MessageSubtypeList supportedSubtypes,
120 TNC_UInt32 typeCount);
121 typedef TNC_Result (*TNC_TNCS_SendMessagePointer)(
122 TNC_IMVID imvID,
123 TNC_ConnectionID connectionID,
124 TNC_BufferReference message,
125 TNC_UInt32 messageLength,
126 TNC_MessageType messageType);
127 typedef TNC_Result (*TNC_TNCS_SendMessageSOHPointer)(
128 TNC_IMVID imvID,
129 TNC_ConnectionID connectionID,
130 TNC_BufferReference sohrReportEntry,
131 TNC_UInt32 sohrRELength);
132 typedef TNC_Result (*TNC_TNCS_SendMessageLongPointer)(
133 TNC_IMVID imvID,
134 TNC_ConnectionID connectionID,
135 TNC_UInt32 messageFlags,
136 TNC_BufferReference message,
137 TNC_UInt32 messageLength,
138 TNC_VendorID messageVendorID,
139 TNC_MessageSubtype messageSubtype,
140 TNC_UInt32 destinationIMCID);
141 typedef TNC_Result (*TNC_TNCS_RequestHandshakeRetryPointer)(
142 TNC_IMVID imvID,
143 TNC_ConnectionID connectionID,
144 TNC_RetryReason reason);
145 typedef TNC_Result (*TNC_TNCS_ProvideRecommendationPointer)(
146 TNC_IMVID imvID,
147 TNC_ConnectionID connectionID,
148 TNC_IMV_Action_Recommendation recommendation,
149 TNC_IMV_Evaluation_Result evaluation);
150 typedef TNC_Result (*TNC_TNCS_GetAttributePointer)(
151 TNC_IMVID imvID,
152 TNC_ConnectionID connectionID,
153 TNC_AttributeID attributeID,
154 TNC_UInt32 bufferLength,
155 TNC_BufferReference buffer,
156 TNC_UInt32 *pOutValueLength);
157 typedef TNC_Result (*TNC_TNCS_SetAttributePointer)(
158 TNC_IMVID imvID,
159 TNC_ConnectionID connectionID,
160 TNC_AttributeID attributeID,
161 TNC_UInt32 bufferLength,
162 TNC_BufferReference buffer);
163 typedef TNC_Result (*TNC_TNCS_ReserveAdditionalIMVIDPointer)(
164 TNC_IMVID imvID,
165 TNC_UInt32 *pOutIMVID);
166 typedef TNC_Result (*TNC_TNCS_BindFunctionPointer)(
167 TNC_IMVID imvID,
168 char *functionName,
169 void **pOutfunctionPointer);
170 typedef TNC_Result (*TNC_IMV_ProvideBindFunctionPointer)(
171 TNC_IMVID imvID,
172 TNC_TNCS_BindFunctionPointer bindFunction);
173
174 /* Version Numbers */
175
176 #define TNC_IFIMV_VERSION_1 1
177
178 /* Handshake Retry Reason Values */
179
180 /* reserved for TNC_RETRY_REASON_IMC_REMEDIATION_COMPLETE: 0 */
181 /* reserved for TNC_RETRY_REASON_IMC_SERIOUS_EVENT: 1 */
182 /* reserved for TNC_RETRY_REASON_IMC_INFORMATIONAL_EVENT: 2 */
183 /* reserved for TNC_RETRY_REASON_IMC_PERIODIC: 3 */
184 #define TNC_RETRY_REASON_IMV_IMPORTANT_POLICY_CHANGE 4
185 #define TNC_RETRY_REASON_IMV_MINOR_POLICY_CHANGE 5
186 #define TNC_RETRY_REASON_IMV_SERIOUS_EVENT 6
187 #define TNC_RETRY_REASON_IMV_MINOR_EVENT 7
188 #define TNC_RETRY_REASON_IMV_PERIODIC 8
189
190 /* IMV Action Recommendation Values */
191
192 #define TNC_IMV_ACTION_RECOMMENDATION_ALLOW 0
193 #define TNC_IMV_ACTION_RECOMMENDATION_NO_ACCESS 1
194 #define TNC_IMV_ACTION_RECOMMENDATION_ISOLATE 2
195 #define TNC_IMV_ACTION_RECOMMENDATION_NO_RECOMMENDATION 3
196
197 /* IMV Evaluation Result Values */
198
199 #define TNC_IMV_EVALUATION_RESULT_COMPLIANT 0
200 #define TNC_IMV_EVALUATION_RESULT_NONCOMPLIANT_MINOR 1
201 #define TNC_IMV_EVALUATION_RESULT_NONCOMPLIANT_MAJOR 2
202 #define TNC_IMV_EVALUATION_RESULT_ERROR 3
203 #define TNC_IMV_EVALUATION_RESULT_DONT_KNOW 4
204
205 /* Message Attribute ID Values */
206
207 #define TNC_ATTRIBUTEID_REASON_STRING ((TNC_AttributeID) 0x00000002)
208 #define TNC_ATTRIBUTEID_REASON_LANGUAGE ((TNC_AttributeID) 0x00000003)
209 #define TNC_ATTRIBUTEID_SOH ((TNC_AttributeID) 0x00559706)
210 #define TNC_ATTRIBUTEID_SSOH ((TNC_AttributeID) 0x00559707)
211 #define TNC_ATTRIBUTEID_PRIMARY_IMV_ID ((TNC_AttributeID) 0x00559710)
212
213 /* IMV Functions */
214
215 TNC_IMV_API TNC_Result TNC_IMV_Initialize(
216 /*in*/ TNC_IMVID imvID,
217 /*in*/ TNC_Version minVersion,
218 /*in*/ TNC_Version maxVersion,
219 /*in*/ TNC_Version *pOutActualVersion);
220
221 TNC_IMV_API TNC_Result TNC_IMV_NotifyConnectionChange(
222 /*in*/ TNC_IMVID imvID,
223 /*in*/ TNC_ConnectionID connectionID,
224 /*in*/ TNC_ConnectionState newState);
225
226 TNC_IMV_API TNC_Result TNC_IMV_ReceiveMessage(
227 /*in*/ TNC_IMVID imvID,
228 /*in*/ TNC_ConnectionID connectionID,
229 /*in*/ TNC_BufferReference messageBuffer,
230 /*in*/ TNC_UInt32 messageLength,
231 /*in*/ TNC_MessageType messageType);
232
233 TNC_IMV_API TNC_Result TNC_IMV_ReceiveMessageSOH(
234 /*in*/ TNC_IMVID imvID,
235 /*in*/ TNC_ConnectionID connectionID,
236 /*in*/ TNC_BufferReference sohReportEntry,
237 /*in*/ TNC_UInt32 sohRELength,
238 /*in*/ TNC_MessageType systemHealthID);
239
240 TNC_IMV_API TNC_Result TNC_IMV_ReceiveMessageLong(
241 /*in*/ TNC_IMVID imvID,
242 /*in*/ TNC_ConnectionID connectionID,
243 /*in*/ TNC_UInt32 messageFlags,
244 /*in*/ TNC_BufferReference message,
245 /*in*/ TNC_UInt32 messageLength,
246 /*in*/ TNC_VendorID messageVendorID,
247 /*in*/ TNC_MessageSubtype messageSubtype,
248 /*in*/ TNC_UInt32 sourceIMCID,
249 /*in*/ TNC_UInt32 destinationIMVID);
250
251 TNC_IMV_API TNC_Result TNC_IMV_SolicitRecommendation(
252 /*in*/ TNC_IMVID imvID,
253 /*in*/ TNC_ConnectionID connectionID);
254
255 TNC_IMV_API TNC_Result TNC_IMV_BatchEnding(
256 /*in*/ TNC_IMVID imvID,
257 /*in*/ TNC_ConnectionID connectionID);
258
259 TNC_IMV_API TNC_Result TNC_IMV_Terminate(
260 /*in*/ TNC_IMVID imvID);
261
262 TNC_IMV_API TNC_Result TNC_IMV_ProvideBindFunction(
263 /*in*/ TNC_IMVID imvID,
264 /*in*/ TNC_TNCS_BindFunctionPointer bindFunction);
265
266 /* TNC Server Functions */
267
268 TNC_Result TNC_TNCS_ReportMessageTypes(
269 /*in*/ TNC_IMVID imvID,
270 /*in*/ TNC_MessageTypeList supportedTypes,
271 /*in*/ TNC_UInt32 typeCount);
272
273 TNC_Result TNC_TNCS_ReportMessageTypesLong(
274 /*in*/ TNC_IMVID imvID,
275 /*in*/ TNC_VendorIDList supportedVendorIDs,
276 /*in*/ TNC_MessageSubtypeList supportedSubtypes,
277 /*in*/ TNC_UInt32 typeCount);
278
279 TNC_Result TNC_TNCS_SendMessage(
280 /*in*/ TNC_IMVID imvID,
281 /*in*/ TNC_ConnectionID connectionID,
282 /*in*/ TNC_BufferReference message,
283 /*in*/ TNC_UInt32 messageLength,
284 /*in*/ TNC_MessageType messageType);
285
286 TNC_Result TNC_TNCS_SendMessageSOH(
287 /*in*/ TNC_IMVID imvID,
288 /*in*/ TNC_ConnectionID connectionID,
289 /*in*/ TNC_BufferReference sohrReportEntry,
290 /*in*/ TNC_UInt32 sohrRELength);
291
292 TNC_Result TNC_TNCS_SendMessageLong(
293 /*in*/ TNC_IMVID imvID,
294 /*in*/ TNC_ConnectionID connectionID,
295 /*in*/ TNC_UInt32 messageFlags,
296 /*in*/ TNC_BufferReference message,
297 /*in*/ TNC_UInt32 messageLength,
298 /*in*/ TNC_VendorID messageVendorID,
299 /*in*/ TNC_MessageSubtype messageSubtype,
300 /*in*/ TNC_UInt32 destinationIMCID);
301
302 TNC_Result TNC_TNCS_RequestHandshakeRetry(
303 /*in*/ TNC_IMVID imvID,
304 /*in*/ TNC_ConnectionID connectionID,
305 /*in*/ TNC_RetryReason reason);
306
307 TNC_Result TNC_TNCS_ProvideRecommendation(
308 /*in*/ TNC_IMVID imvID,
309 /*in*/ TNC_ConnectionID connectionID,
310 /*in*/ TNC_IMV_Action_Recommendation recommendation,
311 /*in*/ TNC_IMV_Evaluation_Result evaluation);
312
313 TNC_Result TNC_TNCS_GetAttribute(
314 /*in*/ TNC_IMVID imvID,
315 /*in*/ TNC_ConnectionID connectionID,
316 /*in*/ TNC_AttributeID attributeID,
317 /*in*/ TNC_UInt32 bufferLength,
318 /*out*/ TNC_BufferReference buffer,
319 /*out*/ TNC_UInt32 *pOutValueLength);
320
321 TNC_Result TNC_TNCS_ReserveAdditionalIMVID(
322 /*in*/ TNC_IMVID imvID,
323 /*out*/ TNC_UInt32 *pOutIMVID);
324
325 TNC_Result TNC_TNCS_SetAttribute(
326 /*in*/ TNC_IMVID imvID,
327 /*in*/ TNC_ConnectionID connectionID,
328 /*in*/ TNC_AttributeID attributeID,
329 /*in*/ TNC_UInt32 bufferLength,
330 /*in*/ TNC_BufferReference buffer);
331 TNC_Result TNC_TNCS_BindFunction(
332 /*in*/ TNC_IMVID imvID,
333 /*in*/ char *functionName,
334 /*in*/ void **pOutfunctionPointer);
335
336 #endif /** TNCIFIMV_H_ @}*/