implemented IMC/IMV handler
[strongswan.git] / src / libcharon / tnc / tncifimc.h
1 /* tncifimc.h
2 *
3 * Trusted Network Connect IF-IMC API version 1.20 Revision 8
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 #ifndef _TNCIFIMC_H
47 #define _TNCIFIMC_H
48
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52
53 #ifdef WIN32
54 #ifdef TNC_IMC_EXPORTS
55 #define TNC_IMC_API __declspec(dllexport)
56 #else
57 #define TNC_IMC_API __declspec(dllimport)
58 #endif
59 #else
60 #define TNC_IMC_API
61 #endif
62
63 #include "tncif.h"
64
65 /* Derived Types */
66
67 typedef TNC_UInt32 TNC_IMCID;
68
69 /* Function pointers */
70
71 typedef TNC_Result (*TNC_IMC_InitializePointer)(
72 TNC_IMCID imcID,
73 TNC_Version minVersion,
74 TNC_Version maxVersion,
75 TNC_Version *pOutActualVersion);
76 typedef TNC_Result (*TNC_IMC_NotifyConnectionChangePointer)(
77 TNC_IMCID imcID,
78 TNC_ConnectionID connectionID,
79 TNC_ConnectionState newState);
80 typedef TNC_Result (*TNC_IMC_BeginHandshakePointer)(
81 TNC_IMCID imcID,
82 TNC_ConnectionID connectionID);
83 typedef TNC_Result (*TNC_IMC_ReceiveMessagePointer)(
84 TNC_IMCID imcID,
85 TNC_ConnectionID connectionID,
86 TNC_BufferReference message,
87 TNC_UInt32 messageLength,
88 TNC_MessageType messageType);
89 typedef TNC_Result (*TNC_IMC_BatchEndingPointer)(
90 TNC_IMCID imcID,
91 TNC_ConnectionID connectionID);
92 typedef TNC_Result (*TNC_IMC_TerminatePointer)(
93 TNC_IMCID imcID);
94 typedef TNC_Result (*TNC_TNCC_ReportMessageTypesPointer)(
95 TNC_IMCID imcID,
96 TNC_MessageTypeList supportedTypes,
97 TNC_UInt32 typeCount);
98 typedef TNC_Result (*TNC_TNCC_SendMessagePointer)(
99 TNC_IMCID imcID,
100 TNC_ConnectionID connectionID,
101 TNC_BufferReference message,
102 TNC_UInt32 messageLength,
103 TNC_MessageType messageType);
104 typedef TNC_Result (*TNC_TNCC_RequestHandshakeRetryPointer)(
105 TNC_IMCID imcID,
106 TNC_ConnectionID connectionID,
107 TNC_RetryReason reason);
108 typedef TNC_Result (*TNC_TNCC_BindFunctionPointer)(
109 TNC_IMCID imcID,
110 char *functionName,
111 void **pOutfunctionPointer);
112 typedef TNC_Result (*TNC_IMC_ProvideBindFunctionPointer)(
113 TNC_IMCID imcID,
114 TNC_TNCC_BindFunctionPointer bindFunction);
115
116 #define TNC_IFIMC_VERSION_1 1
117
118 /* Handshake Retry Reason Values */
119
120 #define TNC_RETRY_REASON_IMC_REMEDIATION_COMPLETE 0
121 #define TNC_RETRY_REASON_IMC_SERIOUS_EVENT 1
122 #define TNC_RETRY_REASON_IMC_INFORMATIONAL_EVENT 2
123 #define TNC_RETRY_REASON_IMC_PERIODIC 3
124 /* reserved for TNC_RETRY_REASON_IMV_IMPORTANT_POLICY_CHANGE: 4 */
125 /* reserved for TNC_RETRY_REASON_IMV_MINOR_POLICY_CHANGE: 5 */
126 /* reserved for TNC_RETRY_REASON_IMV_SERIOUS_EVENT: 6 */
127 /* reserved for TNC_RETRY_REASON_IMV_MINOR_EVENT: 7 */
128 /* reserved for TNC_RETRY_REASON_IMV_PERIODIC: 8 */
129
130 /* IMC Functions */
131
132 TNC_IMC_API TNC_Result TNC_IMC_Initialize(
133 /*in*/ TNC_IMCID imcID,
134 /*in*/ TNC_Version minVersion,
135 /*in*/ TNC_Version maxVersion,
136 /*out*/ TNC_Version *pOutActualVersion);
137
138 TNC_IMC_API TNC_Result TNC_IMC_NotifyConnectionChange(
139 /*in*/ TNC_IMCID imcID,
140 /*in*/ TNC_ConnectionID connectionID,
141 /*in*/ TNC_ConnectionState newState);
142
143 TNC_IMC_API TNC_Result TNC_IMC_BeginHandshake(
144 /*in*/ TNC_IMCID imcID,
145 /*in*/ TNC_ConnectionID connectionID);
146
147 TNC_IMC_API TNC_Result TNC_IMC_ReceiveMessage(
148 /*in*/ TNC_IMCID imcID,
149 /*in*/ TNC_ConnectionID connectionID,
150 /*in*/ TNC_BufferReference messageBuffer,
151 /*in*/ TNC_UInt32 messageLength,
152 /*in*/ TNC_MessageType messageType);
153
154 TNC_IMC_API TNC_Result TNC_IMC_BatchEnding(
155 /*in*/ TNC_IMCID imcID,
156 /*in*/ TNC_ConnectionID connectionID);
157
158 TNC_IMC_API TNC_Result TNC_IMC_Terminate(
159 /*in*/ TNC_IMCID imcID);
160
161 TNC_IMC_API TNC_Result TNC_IMC_ProvideBindFunction(
162 /*in*/ TNC_IMCID imcID,
163 /*in*/ TNC_TNCC_BindFunctionPointer bindFunction);
164
165 /* TNC Client Functions */
166
167 TNC_Result TNC_TNCC_ReportMessageTypes(
168 /*in*/ TNC_IMCID imcID,
169 /*in*/ TNC_MessageTypeList supportedTypes,
170 /*in*/ TNC_UInt32 typeCount);
171
172 TNC_Result TNC_TNCC_SendMessage(
173 /*in*/ TNC_IMCID imcID,
174 /*in*/ TNC_ConnectionID connectionID,
175 /*in*/ TNC_BufferReference message,
176 /*in*/ TNC_UInt32 messageLength,
177 /*in*/ TNC_MessageType messageType);
178
179 TNC_Result TNC_TNCC_RequestHandshakeRetry(
180 /*in*/ TNC_IMCID imcID,
181 /*in*/ TNC_ConnectionID connectionID,
182 /*in*/ TNC_RetryReason reason);
183
184 TNC_Result TNC_TNCC_BindFunction(
185 /*in*/ TNC_IMCID imcID,
186 /*in*/ char *functionName,
187 /*out*/ void **pOutfunctionPointer);
188
189 #ifdef __cplusplus
190 }
191 #endif
192
193 #endif