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