|
1 /* |
|
2 * Copyright (c) 2001-2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: EAP and WLAN authentication protocols. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 #if !defined(_EAPOLTOWLMIF_H_) |
|
23 #define _EAPOLTOWLMIF_H_ |
|
24 |
|
25 #include <umacoidmsg.h> |
|
26 |
|
27 // DATA TYPES |
|
28 |
|
29 // These are the possible indications EAPOL can send to WLM. |
|
30 enum TEapIndication { |
|
31 EAuthenticating, |
|
32 ESuccess, |
|
33 EThisAPFailed, // This AP failed all EAP types. Next AP could be better. |
|
34 EFailedCompletely, // Configuration failure or something else fatal. |
|
35 // No point trying other APs. |
|
36 ENoResponse, |
|
37 ELeapSuccess // Indicates that EAP-LEAP protocol succeeded. |
|
38 // This means that rogue AP results must be sent. |
|
39 }; |
|
40 |
|
41 // The possible rogue AP values |
|
42 enum TRogueType { |
|
43 EInvalidAuthenticationType = 1, |
|
44 EAuthenticationTimeout, |
|
45 EChallengeFromAPFailed, |
|
46 EChallengeToAPFailed |
|
47 }; |
|
48 |
|
49 // Possible cipher suites |
|
50 // RC4 keys are used in WEP, TKIP and CKIP cipher suites. |
|
51 enum TCipherKeyType { |
|
52 ERC4Unicast, |
|
53 ERC4Broadcast |
|
54 }; |
|
55 |
|
56 // CLASS DECLARATION |
|
57 class MEapolToWlmIf |
|
58 { |
|
59 public: |
|
60 |
|
61 /** |
|
62 * Associates the an access point using the specified authentication mode. |
|
63 * @param aAuthenticationMode Authentication mode (open, shared, LEAP) |
|
64 * @return TInt result |
|
65 */ |
|
66 virtual TInt Associate(TAuthenticationMode aAuthenticationMode) = 0; |
|
67 |
|
68 /** |
|
69 * Disassociates from an access point. |
|
70 * @return TInt result |
|
71 */ |
|
72 virtual TInt Disassociate() = 0; |
|
73 |
|
74 /** |
|
75 * Sends an EAP packet. |
|
76 * @param aBufferLength Packet length |
|
77 * @param aBuffer Packet data |
|
78 * @return TInt result |
|
79 */ |
|
80 virtual TInt EapPacketSend( |
|
81 const TUint aBufferLength, |
|
82 const TUint8* const aBuffer) = 0; |
|
83 |
|
84 /** |
|
85 * Indication of some event from EAPOL to WLM. |
|
86 * @param aIndication Event code |
|
87 * @return TInt result |
|
88 */ |
|
89 virtual TInt EapIndication(const TEapIndication aIndication) = 0; |
|
90 |
|
91 /** |
|
92 * Sets the cipher key. When EAPOL has finished authentication it generates cipher keys and |
|
93 * uses this function to send them to WLM and drivers. |
|
94 * @param aKeyType Type of the key to be set. |
|
95 * @param aKeyIndex Index for the key (if applicable) |
|
96 * @param aKeyData Key data |
|
97 * @param aKeyLength Key Length |
|
98 * @return TInt result |
|
99 */ |
|
100 virtual TInt SetCipherKey( |
|
101 const TCipherKeyType aKeyType, |
|
102 const TUint8 aKeyIndex, |
|
103 const TUint8* const aKeyData, |
|
104 const TUint aKeyLength |
|
105 ) = 0; |
|
106 |
|
107 /** |
|
108 * Report the current AP to be rogue. This happens when LEAP authentication |
|
109 * fails for some reason |
|
110 * @param aAddress Address of the rogue AP |
|
111 * @param aRogueType Indicates the type of the failure. |
|
112 * @return TInt result |
|
113 */ |
|
114 virtual TInt AddRogueAP( |
|
115 const TMacAddress& aAddress, |
|
116 const TRogueType aRogueType) = 0; |
|
117 }; |
|
118 |
|
119 #endif //#if !defined(_EAPOLTOWLMIF_H_) |
|
120 |
|
121 //-------------------------------------------------- |
|
122 |
|
123 |
|
124 |
|
125 // End. |