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