3 * Trusted Network Connect IF-IMC API version 1.30
4 * Microsoft Windows DLL Platform Binding C Header
7 * Copyright(c) 2005-2011, Trusted Computing Group, Inc. All rights
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
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
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
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.
37 * Contact the Trusted Computing Group at
38 * admin@trustedcomputinggroup.org for information on specification
39 * licensing through membership agreements.
41 * Any marks and brands contained herein are the property of their
47 * @defgroup tncifimc tncifimc
48 * @{ @ingroup libtncif
57 #ifdef TNC_IMC_EXPORTS
58 #define TNC_IMC_API __declspec(dllexport)
60 #define TNC_IMC_API __declspec(dllimport)
68 typedef TNC_UInt32 TNC_IMCID
;
70 /* Function pointers */
72 typedef TNC_Result (*TNC_IMC_InitializePointer
)(
74 TNC_Version minVersion
,
75 TNC_Version maxVersion
,
76 TNC_Version
*pOutActualVersion
);
77 typedef TNC_Result (*TNC_IMC_NotifyConnectionChangePointer
)(
79 TNC_ConnectionID connectionID
,
80 TNC_ConnectionState newState
);
81 typedef TNC_Result (*TNC_IMC_BeginHandshakePointer
)(
83 TNC_ConnectionID connectionID
);
84 typedef TNC_Result (*TNC_IMC_ReceiveMessagePointer
)(
86 TNC_ConnectionID connectionID
,
87 TNC_BufferReference message
,
88 TNC_UInt32 messageLength
,
89 TNC_MessageType messageType
);
90 typedef TNC_Result (*TNC_IMC_ReceiveMessageSOHPointer
)(
92 TNC_ConnectionID connectionID
,
93 TNC_BufferReference sohrReportEntry
,
94 TNC_UInt32 sohrRELength
,
95 TNC_MessageType systemHealthID
);
96 typedef TNC_Result (*TNC_IMC_ReceiveMessageLongPointer
)(
98 TNC_ConnectionID connectionID
,
99 TNC_UInt32 messageFlags
,
100 TNC_BufferReference message
,
101 TNC_UInt32 messageLength
,
102 TNC_VendorID messageVendorID
,
103 TNC_MessageSubtype messageSubtype
,
104 TNC_UInt32 sourceIMVID
,
105 TNC_UInt32 destinationIMCID
);
106 typedef TNC_Result (*TNC_IMC_BatchEndingPointer
)(
108 TNC_ConnectionID connectionID
);
109 typedef TNC_Result (*TNC_IMC_TerminatePointer
)(
111 typedef TNC_Result (*TNC_TNCC_ReportMessageTypesPointer
)(
113 TNC_MessageTypeList supportedTypes
,
114 TNC_UInt32 typeCount
);
115 typedef TNC_Result (*TNC_TNCC_ReportMessageTypesLongPointer
)(
117 TNC_VendorIDList supportedVendorIDs
,
118 TNC_MessageSubtypeList supportedSubtypes
,
119 TNC_UInt32 typeCount
);
120 typedef TNC_Result (*TNC_TNCC_SendMessagePointer
)(
122 TNC_ConnectionID connectionID
,
123 TNC_BufferReference message
,
124 TNC_UInt32 messageLength
,
125 TNC_MessageType messageType
);
126 typedef TNC_Result (*TNC_TNCC_SendMessageSOHPointer
)(
128 TNC_ConnectionID connectionID
,
129 TNC_BufferReference sohReportEntry
,
130 TNC_UInt32 sohRELength
);
131 typedef TNC_Result (*TNC_TNCC_SendMessageLongPointer
)(
133 TNC_ConnectionID connectionID
,
134 TNC_UInt32 messageFlags
,
135 TNC_BufferReference message
,
136 TNC_UInt32 messageLength
,
137 TNC_VendorID messageVendorID
,
138 TNC_MessageSubtype messageSubtype
,
139 TNC_UInt32 destinationIMVID
);
140 typedef TNC_Result (*TNC_TNCC_RequestHandshakeRetryPointer
)(
142 TNC_ConnectionID connectionID
,
143 TNC_RetryReason reason
);
144 typedef TNC_Result (*TNC_TNCC_GetAttributePointer
)(
146 TNC_ConnectionID connectionID
,
147 TNC_AttributeID attributeID
,
148 TNC_UInt32 bufferLength
,
149 TNC_BufferReference buffer
,
150 TNC_UInt32
*pOutValueLength
);
151 typedef TNC_Result (*TNC_TNCC_SetAttributePointer
)(
153 TNC_ConnectionID connectionID
,
154 TNC_AttributeID attributeID
,
155 TNC_UInt32 bufferLength
,
156 TNC_BufferReference buffer
);
157 typedef TNC_Result (*TNC_TNCC_ReserveAdditionalIMCIDPointer
)(
159 TNC_UInt32
*pOutIMCID
);
160 typedef TNC_Result (*TNC_TNCC_BindFunctionPointer
)(
163 void **pOutfunctionPointer
);
164 typedef TNC_Result (*TNC_IMC_ProvideBindFunctionPointer
)(
166 TNC_TNCC_BindFunctionPointer bindFunction
);
168 /* Version Numbers */
170 #define TNC_IFIMC_VERSION_1 1
172 /* Handshake Retry Reason Values */
174 #define TNC_RETRY_REASON_IMC_REMEDIATION_COMPLETE 0
175 #define TNC_RETRY_REASON_IMC_SERIOUS_EVENT 1
176 #define TNC_RETRY_REASON_IMC_INFORMATIONAL_EVENT 2
177 #define TNC_RETRY_REASON_IMC_PERIODIC 3
178 /* reserved for TNC_RETRY_REASON_IMV_IMPORTANT_POLICY_CHANGE: 4 */
179 /* reserved for TNC_RETRY_REASON_IMV_MINOR_POLICY_CHANGE: 5 */
180 /* reserved for TNC_RETRY_REASON_IMV_SERIOUS_EVENT: 6 */
181 /* reserved for TNC_RETRY_REASON_IMV_MINOR_EVENT: 7 */
182 /* reserved for TNC_RETRY_REASON_IMV_PERIODIC: 8 */
184 /* Message Attribute ID Values */
186 #define TNC_ATTRIBUTEID_SOHR ((TNC_AttributeID) 0x00559708)
187 #define TNC_ATTRIBUTEID_SSOHR ((TNC_AttributeID) 0x00559709)
188 #define TNC_ATTRIBUTEID_PRIMARY_IMC_ID ((TNC_AttributeID) 0x00559711)
192 TNC_IMC_API TNC_Result
TNC_IMC_Initialize(
193 /*in*/ TNC_IMCID imcID
,
194 /*in*/ TNC_Version minVersion
,
195 /*in*/ TNC_Version maxVersion
,
196 /*out*/ TNC_Version
*pOutActualVersion
);
198 TNC_IMC_API TNC_Result
TNC_IMC_NotifyConnectionChange(
199 /*in*/ TNC_IMCID imcID
,
200 /*in*/ TNC_ConnectionID connectionID
,
201 /*in*/ TNC_ConnectionState newState
);
203 TNC_IMC_API TNC_Result
TNC_IMC_BeginHandshake(
204 /*in*/ TNC_IMCID imcID
,
205 /*in*/ TNC_ConnectionID connectionID
);
207 TNC_IMC_API TNC_Result
TNC_IMC_ReceiveMessage(
208 /*in*/ TNC_IMCID imcID
,
209 /*in*/ TNC_ConnectionID connectionID
,
210 /*in*/ TNC_BufferReference messageBuffer
,
211 /*in*/ TNC_UInt32 messageLength
,
212 /*in*/ TNC_MessageType messageType
);
214 TNC_IMC_API TNC_Result
TNC_IMC_ReceiveMessageSOH(
215 /*in*/ TNC_IMCID imcID
,
216 /*in*/ TNC_ConnectionID connectionID
,
217 /*in*/ TNC_BufferReference sohrReportEntry
,
218 /*in*/ TNC_UInt32 sohrRELength
,
219 /*in*/ TNC_MessageType systemHealthID
);
221 TNC_IMC_API TNC_Result
TNC_IMC_ReceiveMessageLong(
222 /*in*/ TNC_IMCID imcID
,
223 /*in*/ TNC_ConnectionID connectionID
,
224 /*in*/ TNC_UInt32 messageFlags
,
225 /*in*/ TNC_BufferReference message
,
226 /*in*/ TNC_UInt32 messageLength
,
227 /*in*/ TNC_VendorID messageVendorID
,
228 /*in*/ TNC_MessageSubtype messageSubtype
,
229 /*in*/ TNC_UInt32 sourceIMVID
,
230 /*in*/ TNC_UInt32 destinationIMCID
);
232 TNC_IMC_API TNC_Result
TNC_IMC_BatchEnding(
233 /*in*/ TNC_IMCID imcID
,
234 /*in*/ TNC_ConnectionID connectionID
);
236 TNC_IMC_API TNC_Result
TNC_IMC_Terminate(
237 /*in*/ TNC_IMCID imcID
);
239 TNC_IMC_API TNC_Result
TNC_IMC_ProvideBindFunction(
240 /*in*/ TNC_IMCID imcID
,
241 /*in*/ TNC_TNCC_BindFunctionPointer bindFunction
);
243 /* TNC Client Functions */
245 TNC_Result
TNC_TNCC_ReportMessageTypes(
246 /*in*/ TNC_IMCID imcID
,
247 /*in*/ TNC_MessageTypeList supportedTypes
,
248 /*in*/ TNC_UInt32 typeCount
);
250 TNC_Result
TNC_TNCC_ReportMessageTypesLong(
251 /*in*/ TNC_IMCID imcID
,
252 /*in*/ TNC_VendorIDList supportedVendorIDs
,
253 /*in*/ TNC_MessageSubtypeList supportedSubtypes
,
254 /*in*/ TNC_UInt32 typeCount
);
256 TNC_Result
TNC_TNCC_SendMessage(
257 /*in*/ TNC_IMCID imcID
,
258 /*in*/ TNC_ConnectionID connectionID
,
259 /*in*/ TNC_BufferReference message
,
260 /*in*/ TNC_UInt32 messageLength
,
261 /*in*/ TNC_MessageType messageType
);
263 TNC_Result
TNC_TNCC_SendMessageSOH(
264 /*in*/ TNC_IMCID imcID
,
265 /*in*/ TNC_ConnectionID connectionID
,
266 /*in*/ TNC_BufferReference sohReportEntry
,
267 /*in*/ TNC_UInt32 sohRELength
);
269 TNC_Result
TNC_TNCC_SendMessageLong(
270 /*in*/ TNC_IMCID imcID
,
271 /*in*/ TNC_ConnectionID connectionID
,
272 /*in*/ TNC_UInt32 messageFlags
,
273 /*in*/ TNC_BufferReference message
,
274 /*in*/ TNC_UInt32 messageLength
,
275 /*in*/ TNC_VendorID messageVendorID
,
276 /*in*/ TNC_MessageSubtype messageSubtype
,
277 /*in*/ TNC_UInt32 destinationIMVID
);
278 TNC_Result
TNC_TNCC_RequestHandshakeRetry(
279 /*in*/ TNC_IMCID imcID
,
280 /*in*/ TNC_ConnectionID connectionID
,
281 /*in*/ TNC_RetryReason reason
);
283 TNC_Result
TNC_TNCC_GetAttribute(
284 /*in*/ TNC_IMCID imcID
,
285 /*in*/ TNC_ConnectionID connectionID
,
286 /*in*/ TNC_AttributeID attributeID
,
287 /*in*/ TNC_UInt32 bufferLength
,
288 /*out*/ TNC_BufferReference buffer
,
289 /*out*/ TNC_UInt32
*pOutValueLength
);
291 TNC_Result
TNC_TNCC_SetAttribute(
292 /*in*/ TNC_IMCID imcID
,
293 /*in*/ TNC_ConnectionID connectionID
,
294 /*in*/ TNC_AttributeID attributeID
,
295 /*in*/ TNC_UInt32 bufferLength
,
296 /*in*/ TNC_BufferReference buffer
);
298 TNC_Result
TNC_TNCS_ReserveAdditionalIMCID(
299 /*in*/ TNC_IMCID imcID
,
300 /*out*/ TNC_UInt32
*pOutIMCID
);
302 TNC_Result
TNC_TNCC_BindFunction(
303 /*in*/ TNC_IMCID imcID
,
304 /*in*/ char *functionName
,
305 /*out*/ void **pOutfunctionPointer
);
307 #endif /** TNCIFIMC_H_ @}*/