Merge branch 'tfc-notify'
[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 #define TNC_ATTRIBUTEID_AR_IDENTITIES ((TNC_AttributeID) 0x00559712)
213
214 /* TNC Identity Types */
215
216 #define TNC_ID_UNKNOWN 0
217 #define TNC_ID_IPV4_ADDR 1
218 #define TNC_ID_IPV6_ADDR 2
219 #define TNC_ID_FQDN 3
220 #define TNC_ID_RFC822_ADDR 4
221 #define TNC_ID_USER_NAME 5
222 #define TNC_ID_DER_ASN1_DN 6
223 #define TNC_ID_DER_ASN1_GN 7
224
225 /* TNC Subject Types */
226
227 #define TNC_SUBJECT_UNKNOWN 0
228 #define TNC_SUBJECT_MACHINE 1
229 #define TNC_SUBJECT_USER 2
230
231 /* TNC Authentication Types */
232
233 #define TNC_AUTH_UNKNOWN 0
234 #define TNC_AUTH_CERT 1
235 #define TNC_AUTH_PASSWORD 2
236 #define TNC_AUTH_SIM 3
237
238 /* IMV Functions */
239
240 TNC_IMV_API TNC_Result TNC_IMV_Initialize(
241 /*in*/ TNC_IMVID imvID,
242 /*in*/ TNC_Version minVersion,
243 /*in*/ TNC_Version maxVersion,
244 /*in*/ TNC_Version *pOutActualVersion);
245
246 TNC_IMV_API TNC_Result TNC_IMV_NotifyConnectionChange(
247 /*in*/ TNC_IMVID imvID,
248 /*in*/ TNC_ConnectionID connectionID,
249 /*in*/ TNC_ConnectionState newState);
250
251 TNC_IMV_API TNC_Result TNC_IMV_ReceiveMessage(
252 /*in*/ TNC_IMVID imvID,
253 /*in*/ TNC_ConnectionID connectionID,
254 /*in*/ TNC_BufferReference messageBuffer,
255 /*in*/ TNC_UInt32 messageLength,
256 /*in*/ TNC_MessageType messageType);
257
258 TNC_IMV_API TNC_Result TNC_IMV_ReceiveMessageSOH(
259 /*in*/ TNC_IMVID imvID,
260 /*in*/ TNC_ConnectionID connectionID,
261 /*in*/ TNC_BufferReference sohReportEntry,
262 /*in*/ TNC_UInt32 sohRELength,
263 /*in*/ TNC_MessageType systemHealthID);
264
265 TNC_IMV_API TNC_Result TNC_IMV_ReceiveMessageLong(
266 /*in*/ TNC_IMVID imvID,
267 /*in*/ TNC_ConnectionID connectionID,
268 /*in*/ TNC_UInt32 messageFlags,
269 /*in*/ TNC_BufferReference message,
270 /*in*/ TNC_UInt32 messageLength,
271 /*in*/ TNC_VendorID messageVendorID,
272 /*in*/ TNC_MessageSubtype messageSubtype,
273 /*in*/ TNC_UInt32 sourceIMCID,
274 /*in*/ TNC_UInt32 destinationIMVID);
275
276 TNC_IMV_API TNC_Result TNC_IMV_SolicitRecommendation(
277 /*in*/ TNC_IMVID imvID,
278 /*in*/ TNC_ConnectionID connectionID);
279
280 TNC_IMV_API TNC_Result TNC_IMV_BatchEnding(
281 /*in*/ TNC_IMVID imvID,
282 /*in*/ TNC_ConnectionID connectionID);
283
284 TNC_IMV_API TNC_Result TNC_IMV_Terminate(
285 /*in*/ TNC_IMVID imvID);
286
287 TNC_IMV_API TNC_Result TNC_IMV_ProvideBindFunction(
288 /*in*/ TNC_IMVID imvID,
289 /*in*/ TNC_TNCS_BindFunctionPointer bindFunction);
290
291 /* TNC Server Functions */
292
293 TNC_Result TNC_TNCS_ReportMessageTypes(
294 /*in*/ TNC_IMVID imvID,
295 /*in*/ TNC_MessageTypeList supportedTypes,
296 /*in*/ TNC_UInt32 typeCount);
297
298 TNC_Result TNC_TNCS_ReportMessageTypesLong(
299 /*in*/ TNC_IMVID imvID,
300 /*in*/ TNC_VendorIDList supportedVendorIDs,
301 /*in*/ TNC_MessageSubtypeList supportedSubtypes,
302 /*in*/ TNC_UInt32 typeCount);
303
304 TNC_Result TNC_TNCS_SendMessage(
305 /*in*/ TNC_IMVID imvID,
306 /*in*/ TNC_ConnectionID connectionID,
307 /*in*/ TNC_BufferReference message,
308 /*in*/ TNC_UInt32 messageLength,
309 /*in*/ TNC_MessageType messageType);
310
311 TNC_Result TNC_TNCS_SendMessageSOH(
312 /*in*/ TNC_IMVID imvID,
313 /*in*/ TNC_ConnectionID connectionID,
314 /*in*/ TNC_BufferReference sohrReportEntry,
315 /*in*/ TNC_UInt32 sohrRELength);
316
317 TNC_Result TNC_TNCS_SendMessageLong(
318 /*in*/ TNC_IMVID imvID,
319 /*in*/ TNC_ConnectionID connectionID,
320 /*in*/ TNC_UInt32 messageFlags,
321 /*in*/ TNC_BufferReference message,
322 /*in*/ TNC_UInt32 messageLength,
323 /*in*/ TNC_VendorID messageVendorID,
324 /*in*/ TNC_MessageSubtype messageSubtype,
325 /*in*/ TNC_UInt32 destinationIMCID);
326
327 TNC_Result TNC_TNCS_RequestHandshakeRetry(
328 /*in*/ TNC_IMVID imvID,
329 /*in*/ TNC_ConnectionID connectionID,
330 /*in*/ TNC_RetryReason reason);
331
332 TNC_Result TNC_TNCS_ProvideRecommendation(
333 /*in*/ TNC_IMVID imvID,
334 /*in*/ TNC_ConnectionID connectionID,
335 /*in*/ TNC_IMV_Action_Recommendation recommendation,
336 /*in*/ TNC_IMV_Evaluation_Result evaluation);
337
338 TNC_Result TNC_TNCS_GetAttribute(
339 /*in*/ TNC_IMVID imvID,
340 /*in*/ TNC_ConnectionID connectionID,
341 /*in*/ TNC_AttributeID attributeID,
342 /*in*/ TNC_UInt32 bufferLength,
343 /*out*/ TNC_BufferReference buffer,
344 /*out*/ TNC_UInt32 *pOutValueLength);
345
346 TNC_Result TNC_TNCS_ReserveAdditionalIMVID(
347 /*in*/ TNC_IMVID imvID,
348 /*out*/ TNC_UInt32 *pOutIMVID);
349
350 TNC_Result TNC_TNCS_SetAttribute(
351 /*in*/ TNC_IMVID imvID,
352 /*in*/ TNC_ConnectionID connectionID,
353 /*in*/ TNC_AttributeID attributeID,
354 /*in*/ TNC_UInt32 bufferLength,
355 /*in*/ TNC_BufferReference buffer);
356 TNC_Result TNC_TNCS_BindFunction(
357 /*in*/ TNC_IMVID imvID,
358 /*in*/ char *functionName,
359 /*in*/ void **pOutfunctionPointer);
360
361 #endif /** TNCIFIMV_H_ @}*/