1*3c260e60Schristos /* 2*3c260e60Schristos * TNC - Common defines 3*3c260e60Schristos * Copyright (c) 2007-2014, Jouni Malinen <j@w1.fi> 4*3c260e60Schristos * 5*3c260e60Schristos * This software may be distributed under the terms of the BSD license. 6*3c260e60Schristos * See README for more details. 7*3c260e60Schristos */ 8*3c260e60Schristos 9*3c260e60Schristos #ifndef TNC_H 10*3c260e60Schristos #define TNC_H 11*3c260e60Schristos 12*3c260e60Schristos typedef unsigned long TNC_UInt32; 13*3c260e60Schristos typedef unsigned char *TNC_BufferReference; 14*3c260e60Schristos 15*3c260e60Schristos typedef TNC_UInt32 TNC_IMVID; 16*3c260e60Schristos typedef TNC_UInt32 TNC_IMCID; 17*3c260e60Schristos typedef TNC_UInt32 TNC_ConnectionID; 18*3c260e60Schristos typedef TNC_UInt32 TNC_ConnectionState; 19*3c260e60Schristos typedef TNC_UInt32 TNC_RetryReason; 20*3c260e60Schristos typedef TNC_UInt32 TNC_IMV_Action_Recommendation; 21*3c260e60Schristos typedef TNC_UInt32 TNC_IMV_Evaluation_Result; 22*3c260e60Schristos typedef TNC_UInt32 TNC_MessageType; 23*3c260e60Schristos typedef TNC_MessageType *TNC_MessageTypeList; 24*3c260e60Schristos typedef TNC_UInt32 TNC_VendorID; 25*3c260e60Schristos typedef TNC_UInt32 TNC_Subtype; 26*3c260e60Schristos typedef TNC_UInt32 TNC_MessageSubtype; 27*3c260e60Schristos typedef TNC_UInt32 TNC_Version; 28*3c260e60Schristos typedef TNC_UInt32 TNC_Result; 29*3c260e60Schristos typedef TNC_UInt32 TNC_AttributeID; 30*3c260e60Schristos 31*3c260e60Schristos typedef TNC_Result (*TNC_TNCS_BindFunctionPointer)( 32*3c260e60Schristos TNC_IMVID imvID, 33*3c260e60Schristos char *functionName, 34*3c260e60Schristos void **pOutfunctionPointer); 35*3c260e60Schristos typedef TNC_Result (*TNC_TNCS_ReportMessageTypesPointer)( 36*3c260e60Schristos TNC_IMVID imvID, 37*3c260e60Schristos TNC_MessageTypeList supportedTypes, 38*3c260e60Schristos TNC_UInt32 typeCount); 39*3c260e60Schristos typedef TNC_Result (*TNC_TNCS_SendMessagePointer)( 40*3c260e60Schristos TNC_IMVID imvID, 41*3c260e60Schristos TNC_ConnectionID connectionID, 42*3c260e60Schristos TNC_BufferReference message, 43*3c260e60Schristos TNC_UInt32 messageLength, 44*3c260e60Schristos TNC_MessageType messageType); 45*3c260e60Schristos typedef TNC_Result (*TNC_TNCS_RequestHandshakeRetryPointer)( 46*3c260e60Schristos TNC_IMVID imvID, 47*3c260e60Schristos TNC_ConnectionID connectionID, 48*3c260e60Schristos TNC_RetryReason reason); 49*3c260e60Schristos typedef TNC_Result (*TNC_TNCS_ProvideRecommendationPointer)( 50*3c260e60Schristos TNC_IMVID imvID, 51*3c260e60Schristos TNC_ConnectionID connectionID, 52*3c260e60Schristos TNC_IMV_Action_Recommendation recommendation, 53*3c260e60Schristos TNC_IMV_Evaluation_Result evaluation); 54*3c260e60Schristos typedef TNC_Result (*TNC_TNCC_BindFunctionPointer)( 55*3c260e60Schristos TNC_IMCID imcID, 56*3c260e60Schristos char *functionName, 57*3c260e60Schristos void **pOutfunctionPointer); 58*3c260e60Schristos typedef TNC_Result (*TNC_TNCC_SendMessagePointer)( 59*3c260e60Schristos TNC_IMCID imcID, 60*3c260e60Schristos TNC_ConnectionID connectionID, 61*3c260e60Schristos TNC_BufferReference message, 62*3c260e60Schristos TNC_UInt32 messageLength, 63*3c260e60Schristos TNC_MessageType messageType); 64*3c260e60Schristos typedef TNC_Result (*TNC_TNCC_ReportMessageTypesPointer)( 65*3c260e60Schristos TNC_IMCID imcID, 66*3c260e60Schristos TNC_MessageTypeList supportedTypes, 67*3c260e60Schristos TNC_UInt32 typeCount); 68*3c260e60Schristos typedef TNC_Result (*TNC_TNCC_RequestHandshakeRetryPointer)( 69*3c260e60Schristos TNC_IMCID imcID, 70*3c260e60Schristos TNC_ConnectionID connectionID, 71*3c260e60Schristos TNC_RetryReason reason); 72*3c260e60Schristos 73*3c260e60Schristos #define TNC_IFIMV_VERSION_1 1 74*3c260e60Schristos #define TNC_IFIMC_VERSION_1 1 75*3c260e60Schristos 76*3c260e60Schristos #define TNC_RESULT_SUCCESS 0 77*3c260e60Schristos #define TNC_RESULT_NOT_INITIALIZED 1 78*3c260e60Schristos #define TNC_RESULT_ALREADY_INITIALIZED 2 79*3c260e60Schristos #define TNC_RESULT_NO_COMMON_VERSION 3 80*3c260e60Schristos #define TNC_RESULT_CANT_RETRY 4 81*3c260e60Schristos #define TNC_RESULT_WONT_RETRY 5 82*3c260e60Schristos #define TNC_RESULT_INVALID_PARAMETER 6 83*3c260e60Schristos #define TNC_RESULT_CANT_RESPOND 7 84*3c260e60Schristos #define TNC_RESULT_ILLEGAL_OPERATION 8 85*3c260e60Schristos #define TNC_RESULT_OTHER 9 86*3c260e60Schristos #define TNC_RESULT_FATAL 10 87*3c260e60Schristos 88*3c260e60Schristos #define TNC_CONNECTION_STATE_CREATE 0 89*3c260e60Schristos #define TNC_CONNECTION_STATE_HANDSHAKE 1 90*3c260e60Schristos #define TNC_CONNECTION_STATE_ACCESS_ALLOWED 2 91*3c260e60Schristos #define TNC_CONNECTION_STATE_ACCESS_ISOLATED 3 92*3c260e60Schristos #define TNC_CONNECTION_STATE_ACCESS_NONE 4 93*3c260e60Schristos #define TNC_CONNECTION_STATE_DELETE 5 94*3c260e60Schristos 95*3c260e60Schristos #define TNC_VENDORID_ANY ((TNC_VendorID) 0xffffff) 96*3c260e60Schristos #define TNC_SUBTYPE_ANY ((TNC_Subtype) 0xff) 97*3c260e60Schristos 98*3c260e60Schristos /* TNCC-TNCS Message Types */ 99*3c260e60Schristos #define TNC_TNCCS_RECOMMENDATION 0x00000001 100*3c260e60Schristos #define TNC_TNCCS_ERROR 0x00000002 101*3c260e60Schristos #define TNC_TNCCS_PREFERREDLANGUAGE 0x00000003 102*3c260e60Schristos #define TNC_TNCCS_REASONSTRINGS 0x00000004 103*3c260e60Schristos 104*3c260e60Schristos /* Possible TNC_IMV_Action_Recommendation values: */ 105*3c260e60Schristos enum IMV_Action_Recommendation { 106*3c260e60Schristos TNC_IMV_ACTION_RECOMMENDATION_ALLOW, 107*3c260e60Schristos TNC_IMV_ACTION_RECOMMENDATION_NO_ACCESS, 108*3c260e60Schristos TNC_IMV_ACTION_RECOMMENDATION_ISOLATE, 109*3c260e60Schristos TNC_IMV_ACTION_RECOMMENDATION_NO_RECOMMENDATION 110*3c260e60Schristos }; 111*3c260e60Schristos 112*3c260e60Schristos /* Possible TNC_IMV_Evaluation_Result values: */ 113*3c260e60Schristos enum IMV_Evaluation_Result { 114*3c260e60Schristos TNC_IMV_EVALUATION_RESULT_COMPLIANT, 115*3c260e60Schristos TNC_IMV_EVALUATION_RESULT_NONCOMPLIANT_MINOR, 116*3c260e60Schristos TNC_IMV_EVALUATION_RESULT_NONCOMPLIANT_MAJOR, 117*3c260e60Schristos TNC_IMV_EVALUATION_RESULT_ERROR, 118*3c260e60Schristos TNC_IMV_EVALUATION_RESULT_DONT_KNOW 119*3c260e60Schristos }; 120*3c260e60Schristos 121*3c260e60Schristos #endif /* TNC_H */ 122