fixed typo
[strongswan.git] / src / libtncif / tncifimv.h
1 /* tncifimv.h
2 *
3 * Trusted Network Connect IF-IMV API version 1.20
4 * Microsoft Windows DLL Platform Binding C Header
5 * February 5, 2007
6 *
7 * Copyright(c) 2005-2007, 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 * - Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * - 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 * - 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 #ifndef TNCIFIMV_H_
46 #define TNCIFIMV_H_
47
48 #include "tncif.h"
49
50 typedef TNC_UInt32 TNC_IMVID;
51 typedef TNC_UInt32 TNC_IMV_Action_Recommendation;
52 typedef TNC_UInt32 TNC_IMV_Evaluation_Result;
53 typedef TNC_UInt32 TNC_AttributeID;
54
55 /* Function pointers */
56
57 typedef TNC_Result (*TNC_IMV_InitializePointer)(
58 TNC_IMVID imvID,
59 TNC_Version minVersion,
60 TNC_Version maxVersion,
61 TNC_Version *pOutActualVersion);
62 typedef TNC_Result (*TNC_IMV_NotifyConnectionChangePointer)(
63 TNC_IMVID imvID,
64 TNC_ConnectionID connectionID,
65 TNC_ConnectionState newState);
66 typedef TNC_Result (*TNC_IMV_ReceiveMessagePointer)(
67 TNC_IMVID imvID,
68 TNC_ConnectionID connectionID,
69 TNC_BufferReference message,
70 TNC_UInt32 messageLength,
71 TNC_MessageType messageType);
72 typedef TNC_Result (*TNC_IMV_SolicitRecommendationPointer)(
73 TNC_IMVID imvID,
74 TNC_ConnectionID connectionID);
75 typedef TNC_Result (*TNC_IMV_BatchEndingPointer)(
76 TNC_IMVID imvID,
77 TNC_ConnectionID connectionID);
78 typedef TNC_Result (*TNC_IMV_TerminatePointer)(
79 TNC_IMVID imvID);
80 typedef TNC_Result (*TNC_TNCS_ReportMessageTypesPointer)(
81 TNC_IMVID imvID,
82 TNC_MessageTypeList supportedTypes,
83 TNC_UInt32 typeCount);
84 typedef TNC_Result (*TNC_TNCS_SendMessagePointer)(
85 TNC_IMVID imvID,
86 TNC_ConnectionID connectionID,
87 TNC_BufferReference message,
88 TNC_UInt32 messageLength,
89 TNC_MessageType messageType);
90 typedef TNC_Result (*TNC_TNCS_RequestHandshakeRetryPointer)(
91 TNC_IMVID imvID,
92 TNC_ConnectionID connectionID,
93 TNC_RetryReason reason);
94 typedef TNC_Result (*TNC_TNCS_ProvideRecommendationPointer)(
95 TNC_IMVID imvID,
96 TNC_ConnectionID connectionID,
97 TNC_IMV_Action_Recommendation recommendation,
98 TNC_IMV_Evaluation_Result evaluation);
99 typedef TNC_Result (*TNC_TNCS_GetAttributePointer)(
100 TNC_IMVID imvID,
101 TNC_ConnectionID connectionID,
102 TNC_AttributeID attributeID,
103 TNC_UInt32 bufferLength,
104 TNC_BufferReference buffer,
105 TNC_UInt32 *pOutValueLength);
106 typedef TNC_Result (*TNC_TNCS_SetAttributePointer)(
107 TNC_IMVID imvID,
108 TNC_ConnectionID connectionID,
109 TNC_AttributeID attributeID,
110 TNC_UInt32 bufferLength,
111 TNC_BufferReference buffer);
112 typedef TNC_Result (*TNC_TNCS_BindFunctionPointer)(
113 TNC_IMVID imvID,
114 char *functionName,
115 void **pOutfunctionPointer);
116 typedef TNC_Result (*TNC_IMV_ProvideBindFunctionPointer)(
117 TNC_IMVID imvID,
118 TNC_TNCS_BindFunctionPointer bindFunction);
119
120 /* Version Numbers */
121
122 #define TNC_IFIMV_VERSION_1 1
123
124 /* Handshake Retry Reason Values */
125
126 /* reserved for TNC_RETRY_REASON_IMC_REMEDIATION_COMPLETE: 0 */
127 /* reserved for TNC_RETRY_REASON_IMC_SERIOUS_EVENT: 1 */
128 /* reserved for TNC_RETRY_REASON_IMC_INFORMATIONAL_EVENT: 2 */
129 /* reserved for TNC_RETRY_REASON_IMC_PERIODIC: 3 */
130 #define TNC_RETRY_REASON_IMV_IMPORTANT_POLICY_CHANGE 4
131 #define TNC_RETRY_REASON_IMV_MINOR_POLICY_CHANGE 5
132 #define TNC_RETRY_REASON_IMV_SERIOUS_EVENT 6
133 #define TNC_RETRY_REASON_IMV_MINOR_EVENT 7
134 #define TNC_RETRY_REASON_IMV_PERIODIC 8
135
136 /* IMV Action Recommendation Values */
137
138 #define TNC_IMV_ACTION_RECOMMENDATION_ALLOW 0
139 #define TNC_IMV_ACTION_RECOMMENDATION_NO_ACCESS 1
140 #define TNC_IMV_ACTION_RECOMMENDATION_ISOLATE 2
141 #define TNC_IMV_ACTION_RECOMMENDATION_NO_RECOMMENDATION 3
142
143 /* IMV Evaluation Result Values */
144
145 #define TNC_IMV_EVALUATION_RESULT_COMPLIANT 0
146 #define TNC_IMV_EVALUATION_RESULT_NONCOMPLIANT_MINOR 1
147 #define TNC_IMV_EVALUATION_RESULT_NONCOMPLIANT_MAJOR 2
148 #define TNC_IMV_EVALUATION_RESULT_ERROR 3
149 #define TNC_IMV_EVALUATION_RESULT_DONT_KNOW 4
150
151 /* Message Attribute ID Values */
152
153 #define TNC_ATTRIBUTEID_PREFERRED_LANGUAGE ((TNC_AttributeID) 0x00000001)
154 #define TNC_ATTRIBUTEID_REASON_STRING ((TNC_AttributeID) 0x00000002)
155 #define TNC_ATTRIBUTEID_REASON_LANGUAGE ((TNC_AttributeID) 0x00000003)
156
157 /* IMV Functions */
158
159 TNC_Result TNC_IMV_Initialize(
160 /*in*/ TNC_IMVID imvID,
161 /*in*/ TNC_Version minVersion,
162 /*in*/ TNC_Version maxVersion,
163 /*in*/ TNC_Version *pOutActualVersion);
164
165 TNC_Result TNC_IMV_NotifyConnectionChange(
166 /*in*/ TNC_IMVID imvID,
167 /*in*/ TNC_ConnectionID connectionID,
168 /*in*/ TNC_ConnectionState newState);
169
170 TNC_Result TNC_IMV_ReceiveMessage(
171 /*in*/ TNC_IMVID imvID,
172 /*in*/ TNC_ConnectionID connectionID,
173 /*in*/ TNC_BufferReference messageBuffer,
174 /*in*/ TNC_UInt32 messageLength,
175 /*in*/ TNC_MessageType messageType);
176
177 TNC_Result TNC_IMV_SolicitRecommendation(
178 /*in*/ TNC_IMVID imvID,
179 /*in*/ TNC_ConnectionID connectionID);
180
181 TNC_Result TNC_IMV_BatchEnding(
182 /*in*/ TNC_IMVID imvID,
183 /*in*/ TNC_ConnectionID connectionID);
184
185 TNC_Result TNC_IMV_Terminate(
186 /*in*/ TNC_IMVID imvID);
187
188 TNC_Result TNC_IMV_ProvideBindFunction(
189 /*in*/ TNC_IMVID imvID,
190 /*in*/ TNC_TNCS_BindFunctionPointer bindFunction);
191
192 /* TNC Server Functions */
193
194 TNC_Result TNC_TNCS_ReportMessageTypes(
195 /*in*/ TNC_IMVID imvID,
196 /*in*/ TNC_MessageTypeList supportedTypes,
197 /*in*/ TNC_UInt32 typeCount);
198
199 TNC_Result TNC_TNCS_SendMessage(
200 /*in*/ TNC_IMVID imvID,
201 /*in*/ TNC_ConnectionID connectionID,
202 /*in*/ TNC_BufferReference message,
203 /*in*/ TNC_UInt32 messageLength,
204 /*in*/ TNC_MessageType messageType);
205
206 TNC_Result TNC_TNCS_RequestHandshakeRetry(
207 /*in*/ TNC_IMVID imvID,
208 /*in*/ TNC_ConnectionID connectionID,
209 /*in*/ TNC_RetryReason reason);
210
211 TNC_Result TNC_TNCS_ProvideRecommendation(
212 /*in*/ TNC_IMVID imvID,
213 /*in*/ TNC_ConnectionID connectionID,
214 /*in*/ TNC_IMV_Action_Recommendation recommendation,
215 /*in*/ TNC_IMV_Evaluation_Result evaluation);
216
217 TNC_Result TNC_TNCS_GetAttribute(
218 /*in*/ TNC_IMVID imvID,
219 /*in*/ TNC_ConnectionID connectionID,
220 /*in*/ TNC_AttributeID attributeID,
221 /*in*/ TNC_UInt32 bufferLength,
222 /*out*/ TNC_BufferReference buffer,
223 /*out*/ TNC_UInt32 *pOutValueLength);
224
225 TNC_Result TNC_TNCS_SetAttribute(
226 /*in*/ TNC_IMVID imvID,
227 /*in*/ TNC_ConnectionID connectionID,
228 /*in*/ TNC_AttributeID attributeID,
229 /*in*/ TNC_UInt32 bufferLength,
230 /*in*/ TNC_BufferReference buffer);
231
232 TNC_Result TNC_TNCS_BindFunction(
233 /*in*/ TNC_IMVID imvID,
234 /*in*/ char *functionName,
235 /*in*/ void **pOutfunctionPointer);
236
237 #endif /** TNCIFIMV_H_ @}*/