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