tncifimv.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  1. /* tncifimv.h
  2. *
  3. * Trusted Network Connect IF-IMV API version 1.30
  4. * Microsoft Windows DLL Platform Binding C Header
  5. * October 14, 2011
  6. *
  7. * Copyright(c) 2005-2011, 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. * 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
  18. * distribution.
  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
  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. * @defgroup tncifimv tncifimv
  46. * @{ @ingroup libtncif
  47. */
  48. #ifndef TNCIFIMV_H_
  49. #define TNCIFIMV_H_
  50. #include "tncif.h"
  51. #ifdef WIN32
  52. #ifdef TNC_IMV_EXPORTS
  53. #define TNC_IMV_API __declspec(dllexport)
  54. #else
  55. #define TNC_IMV_API __declspec(dllimport)
  56. #endif
  57. #else
  58. #define TNC_IMV_API
  59. #endif
  60. /* Derived Types */
  61. typedef TNC_UInt32 TNC_IMVID;
  62. typedef TNC_UInt32 TNC_IMV_Action_Recommendation;
  63. typedef TNC_UInt32 TNC_IMV_Evaluation_Result;
  64. /* Function pointers */
  65. typedef TNC_Result (*TNC_IMV_InitializePointer)(
  66. TNC_IMVID imvID,
  67. TNC_Version minVersion,
  68. TNC_Version maxVersion,
  69. TNC_Version *pOutActualVersion);
  70. typedef TNC_Result (*TNC_IMV_NotifyConnectionChangePointer)(
  71. TNC_IMVID imvID,
  72. TNC_ConnectionID connectionID,
  73. TNC_ConnectionState newState);
  74. typedef TNC_Result (*TNC_IMV_ReceiveMessagePointer)(
  75. TNC_IMVID imvID,
  76. TNC_ConnectionID connectionID,
  77. TNC_BufferReference message,
  78. TNC_UInt32 messageLength,
  79. TNC_MessageType messageType);
  80. typedef TNC_Result (*TNC_IMV_ReceiveMessageSOHPointer)(
  81. TNC_IMVID imvID,
  82. TNC_ConnectionID connectionID,
  83. TNC_BufferReference sohReportEntry,
  84. TNC_UInt32 sohRELength,
  85. TNC_MessageType systemHealthID);
  86. typedef TNC_Result (*TNC_IMV_ReceiveMessageLongPointer)(
  87. TNC_IMVID imvID,
  88. TNC_ConnectionID connectionID,
  89. TNC_UInt32 messageFlags,
  90. TNC_BufferReference message,
  91. TNC_UInt32 messageLength,
  92. TNC_VendorID messageVendorID,
  93. TNC_MessageSubtype messageSubtype,
  94. TNC_UInt32 sourceIMCID,
  95. TNC_UInt32 destinationIMVID);
  96. typedef TNC_Result (*TNC_IMV_SolicitRecommendationPointer)(
  97. TNC_IMVID imvID,
  98. TNC_ConnectionID connectionID);
  99. typedef TNC_Result (*TNC_IMV_BatchEndingPointer)(
  100. TNC_IMVID imvID,
  101. TNC_ConnectionID connectionID);
  102. typedef TNC_Result (*TNC_IMV_TerminatePointer)(
  103. TNC_IMVID imvID);
  104. typedef TNC_Result (*TNC_TNCS_ReportMessageTypesPointer)(
  105. TNC_IMVID imvID,
  106. TNC_MessageTypeList supportedTypes,
  107. TNC_UInt32 typeCount);
  108. typedef TNC_Result (*TNC_TNCS_ReportMessageTypesLongPointer)(
  109. TNC_IMVID imvID,
  110. TNC_VendorIDList supportedVendorIDs,
  111. TNC_MessageSubtypeList supportedSubtypes,
  112. TNC_UInt32 typeCount);
  113. typedef TNC_Result (*TNC_TNCS_SendMessagePointer)(
  114. TNC_IMVID imvID,
  115. TNC_ConnectionID connectionID,
  116. TNC_BufferReference message,
  117. TNC_UInt32 messageLength,
  118. TNC_MessageType messageType);
  119. typedef TNC_Result (*TNC_TNCS_SendMessageSOHPointer)(
  120. TNC_IMVID imvID,
  121. TNC_ConnectionID connectionID,
  122. TNC_BufferReference sohrReportEntry,
  123. TNC_UInt32 sohrRELength);
  124. typedef TNC_Result (*TNC_TNCS_SendMessageLongPointer)(
  125. TNC_IMVID imvID,
  126. TNC_ConnectionID connectionID,
  127. TNC_UInt32 messageFlags,
  128. TNC_BufferReference message,
  129. TNC_UInt32 messageLength,
  130. TNC_VendorID messageVendorID,
  131. TNC_MessageSubtype messageSubtype,
  132. TNC_UInt32 destinationIMCID);
  133. typedef TNC_Result (*TNC_TNCS_RequestHandshakeRetryPointer)(
  134. TNC_IMVID imvID,
  135. TNC_ConnectionID connectionID,
  136. TNC_RetryReason reason);
  137. typedef TNC_Result (*TNC_TNCS_ProvideRecommendationPointer)(
  138. TNC_IMVID imvID,
  139. TNC_ConnectionID connectionID,
  140. TNC_IMV_Action_Recommendation recommendation,
  141. TNC_IMV_Evaluation_Result evaluation);
  142. typedef TNC_Result (*TNC_TNCS_GetAttributePointer)(
  143. TNC_IMVID imvID,
  144. TNC_ConnectionID connectionID,
  145. TNC_AttributeID attributeID,
  146. TNC_UInt32 bufferLength,
  147. TNC_BufferReference buffer,
  148. TNC_UInt32 *pOutValueLength);
  149. typedef TNC_Result (*TNC_TNCS_SetAttributePointer)(
  150. TNC_IMVID imvID,
  151. TNC_ConnectionID connectionID,
  152. TNC_AttributeID attributeID,
  153. TNC_UInt32 bufferLength,
  154. TNC_BufferReference buffer);
  155. typedef TNC_Result (*TNC_TNCS_ReserveAdditionalIMVIDPointer)(
  156. TNC_IMVID imvID,
  157. TNC_UInt32 *pOutIMVID);
  158. typedef TNC_Result (*TNC_TNCS_BindFunctionPointer)(
  159. TNC_IMVID imvID,
  160. char *functionName,
  161. void **pOutfunctionPointer);
  162. typedef TNC_Result (*TNC_IMV_ProvideBindFunctionPointer)(
  163. TNC_IMVID imvID,
  164. TNC_TNCS_BindFunctionPointer bindFunction);
  165. /* Version Numbers */
  166. #define TNC_IFIMV_VERSION_1 1
  167. /* Handshake Retry Reason Values */
  168. /* reserved for TNC_RETRY_REASON_IMC_REMEDIATION_COMPLETE: 0 */
  169. /* reserved for TNC_RETRY_REASON_IMC_SERIOUS_EVENT: 1 */
  170. /* reserved for TNC_RETRY_REASON_IMC_INFORMATIONAL_EVENT: 2 */
  171. /* reserved for TNC_RETRY_REASON_IMC_PERIODIC: 3 */
  172. #define TNC_RETRY_REASON_IMV_IMPORTANT_POLICY_CHANGE 4
  173. #define TNC_RETRY_REASON_IMV_MINOR_POLICY_CHANGE 5
  174. #define TNC_RETRY_REASON_IMV_SERIOUS_EVENT 6
  175. #define TNC_RETRY_REASON_IMV_MINOR_EVENT 7
  176. #define TNC_RETRY_REASON_IMV_PERIODIC 8
  177. /* IMV Action Recommendation Values */
  178. #define TNC_IMV_ACTION_RECOMMENDATION_ALLOW 0
  179. #define TNC_IMV_ACTION_RECOMMENDATION_NO_ACCESS 1
  180. #define TNC_IMV_ACTION_RECOMMENDATION_ISOLATE 2
  181. #define TNC_IMV_ACTION_RECOMMENDATION_NO_RECOMMENDATION 3
  182. /* IMV Evaluation Result Values */
  183. #define TNC_IMV_EVALUATION_RESULT_COMPLIANT 0
  184. #define TNC_IMV_EVALUATION_RESULT_NONCOMPLIANT_MINOR 1
  185. #define TNC_IMV_EVALUATION_RESULT_NONCOMPLIANT_MAJOR 2
  186. #define TNC_IMV_EVALUATION_RESULT_ERROR 3
  187. #define TNC_IMV_EVALUATION_RESULT_DONT_KNOW 4
  188. /* Message Attribute ID Values */
  189. #define TNC_ATTRIBUTEID_REASON_STRING ((TNC_AttributeID) 0x00000002)
  190. #define TNC_ATTRIBUTEID_REASON_LANGUAGE ((TNC_AttributeID) 0x00000003)
  191. #define TNC_ATTRIBUTEID_SOH ((TNC_AttributeID) 0x00559706)
  192. #define TNC_ATTRIBUTEID_SSOH ((TNC_AttributeID) 0x00559707)
  193. #define TNC_ATTRIBUTEID_PRIMARY_IMV_ID ((TNC_AttributeID) 0x00559710)
  194. #define TNC_ATTRIBUTEID_AR_IDENTITIES ((TNC_AttributeID) 0x00559712)
  195. /* TNC Identity Types */
  196. #define TNC_ID_UNKNOWN 0
  197. #define TNC_ID_IPV4_ADDR 1
  198. #define TNC_ID_IPV6_ADDR 2
  199. #define TNC_ID_FQDN 3
  200. #define TNC_ID_EMAIL_ADDR 4
  201. #define TNC_ID_USERNAME 5
  202. #define TNC_ID_X500_DN 6
  203. /* TNC Subject Types */
  204. #define TNC_SUBJECT_UNKNOWN 0
  205. #define TNC_SUBJECT_MACHINE 1
  206. #define TNC_SUBJECT_USER 2
  207. /* TNC Authentication Types */
  208. #define TNC_AUTH_UNKNOWN 0
  209. #define TNC_AUTH_X509_CERT 1
  210. #define TNC_AUTH_PASSWORD 2
  211. #define TNC_AUTH_SIM 3
  212. /* IMV Functions */
  213. TNC_IMV_API TNC_Result TNC_IMV_Initialize(
  214. /*in*/ TNC_IMVID imvID,
  215. /*in*/ TNC_Version minVersion,
  216. /*in*/ TNC_Version maxVersion,
  217. /*in*/ TNC_Version *pOutActualVersion);
  218. TNC_IMV_API TNC_Result TNC_IMV_NotifyConnectionChange(
  219. /*in*/ TNC_IMVID imvID,
  220. /*in*/ TNC_ConnectionID connectionID,
  221. /*in*/ TNC_ConnectionState newState);
  222. TNC_IMV_API TNC_Result TNC_IMV_ReceiveMessage(
  223. /*in*/ TNC_IMVID imvID,
  224. /*in*/ TNC_ConnectionID connectionID,
  225. /*in*/ TNC_BufferReference messageBuffer,
  226. /*in*/ TNC_UInt32 messageLength,
  227. /*in*/ TNC_MessageType messageType);
  228. TNC_IMV_API TNC_Result TNC_IMV_ReceiveMessageSOH(
  229. /*in*/ TNC_IMVID imvID,
  230. /*in*/ TNC_ConnectionID connectionID,
  231. /*in*/ TNC_BufferReference sohReportEntry,
  232. /*in*/ TNC_UInt32 sohRELength,
  233. /*in*/ TNC_MessageType systemHealthID);
  234. TNC_IMV_API TNC_Result TNC_IMV_ReceiveMessageLong(
  235. /*in*/ TNC_IMVID imvID,
  236. /*in*/ TNC_ConnectionID connectionID,
  237. /*in*/ TNC_UInt32 messageFlags,
  238. /*in*/ TNC_BufferReference message,
  239. /*in*/ TNC_UInt32 messageLength,
  240. /*in*/ TNC_VendorID messageVendorID,
  241. /*in*/ TNC_MessageSubtype messageSubtype,
  242. /*in*/ TNC_UInt32 sourceIMCID,
  243. /*in*/ TNC_UInt32 destinationIMVID);
  244. TNC_IMV_API TNC_Result TNC_IMV_SolicitRecommendation(
  245. /*in*/ TNC_IMVID imvID,
  246. /*in*/ TNC_ConnectionID connectionID);
  247. TNC_IMV_API TNC_Result TNC_IMV_BatchEnding(
  248. /*in*/ TNC_IMVID imvID,
  249. /*in*/ TNC_ConnectionID connectionID);
  250. TNC_IMV_API TNC_Result TNC_IMV_Terminate(
  251. /*in*/ TNC_IMVID imvID);
  252. TNC_IMV_API TNC_Result TNC_IMV_ProvideBindFunction(
  253. /*in*/ TNC_IMVID imvID,
  254. /*in*/ TNC_TNCS_BindFunctionPointer bindFunction);
  255. /* TNC Server Functions */
  256. TNC_Result TNC_TNCS_ReportMessageTypes(
  257. /*in*/ TNC_IMVID imvID,
  258. /*in*/ TNC_MessageTypeList supportedTypes,
  259. /*in*/ TNC_UInt32 typeCount);
  260. TNC_Result TNC_TNCS_ReportMessageTypesLong(
  261. /*in*/ TNC_IMVID imvID,
  262. /*in*/ TNC_VendorIDList supportedVendorIDs,
  263. /*in*/ TNC_MessageSubtypeList supportedSubtypes,
  264. /*in*/ TNC_UInt32 typeCount);
  265. TNC_Result TNC_TNCS_SendMessage(
  266. /*in*/ TNC_IMVID imvID,
  267. /*in*/ TNC_ConnectionID connectionID,
  268. /*in*/ TNC_BufferReference message,
  269. /*in*/ TNC_UInt32 messageLength,
  270. /*in*/ TNC_MessageType messageType);
  271. TNC_Result TNC_TNCS_SendMessageSOH(
  272. /*in*/ TNC_IMVID imvID,
  273. /*in*/ TNC_ConnectionID connectionID,
  274. /*in*/ TNC_BufferReference sohrReportEntry,
  275. /*in*/ TNC_UInt32 sohrRELength);
  276. TNC_Result TNC_TNCS_SendMessageLong(
  277. /*in*/ TNC_IMVID imvID,
  278. /*in*/ TNC_ConnectionID connectionID,
  279. /*in*/ TNC_UInt32 messageFlags,
  280. /*in*/ TNC_BufferReference message,
  281. /*in*/ TNC_UInt32 messageLength,
  282. /*in*/ TNC_VendorID messageVendorID,
  283. /*in*/ TNC_MessageSubtype messageSubtype,
  284. /*in*/ TNC_UInt32 destinationIMCID);
  285. TNC_Result TNC_TNCS_RequestHandshakeRetry(
  286. /*in*/ TNC_IMVID imvID,
  287. /*in*/ TNC_ConnectionID connectionID,
  288. /*in*/ TNC_RetryReason reason);
  289. TNC_Result TNC_TNCS_ProvideRecommendation(
  290. /*in*/ TNC_IMVID imvID,
  291. /*in*/ TNC_ConnectionID connectionID,
  292. /*in*/ TNC_IMV_Action_Recommendation recommendation,
  293. /*in*/ TNC_IMV_Evaluation_Result evaluation);
  294. TNC_Result TNC_TNCS_GetAttribute(
  295. /*in*/ TNC_IMVID imvID,
  296. /*in*/ TNC_ConnectionID connectionID,
  297. /*in*/ TNC_AttributeID attributeID,
  298. /*in*/ TNC_UInt32 bufferLength,
  299. /*out*/ TNC_BufferReference buffer,
  300. /*out*/ TNC_UInt32 *pOutValueLength);
  301. TNC_Result TNC_TNCS_ReserveAdditionalIMVID(
  302. /*in*/ TNC_IMVID imvID,
  303. /*out*/ TNC_UInt32 *pOutIMVID);
  304. TNC_Result TNC_TNCS_SetAttribute(
  305. /*in*/ TNC_IMVID imvID,
  306. /*in*/ TNC_ConnectionID connectionID,
  307. /*in*/ TNC_AttributeID attributeID,
  308. /*in*/ TNC_UInt32 bufferLength,
  309. /*in*/ TNC_BufferReference buffer);
  310. TNC_Result TNC_TNCS_BindFunction(
  311. /*in*/ TNC_IMVID imvID,
  312. /*in*/ char *functionName,
  313. /*in*/ void **pOutfunctionPointer);
  314. #endif /** TNCIFIMV_H_ @}*/