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