|
1 /* |
|
2 * Copyright (c) 2002 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 "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: Wlan Adapter commsDB handler |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __NSMLWLANSETTINGS_H__ |
|
19 #define __NSMLWLANSETTINGS_H__ |
|
20 |
|
21 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
22 #include <commsdat_partner.h> |
|
23 #endif |
|
24 #include <commdb.h> |
|
25 #include <commsdattypesv1_1.h> |
|
26 #include <EapType.h> |
|
27 |
|
28 const TInt KMaxPSKLength = 63; |
|
29 const TInt KMinPSKLength = 8; |
|
30 |
|
31 // ========================================================================== |
|
32 // Class forwards |
|
33 // ========================================================================== |
|
34 // |
|
35 class CWlanSettings; |
|
36 |
|
37 class TWlanSettings |
|
38 { |
|
39 public: |
|
40 TBuf<KMaxTextLength> Name; |
|
41 TUint32 Id; |
|
42 TUint32 ServiceID; |
|
43 TUint32 ConnectionMode; // Infrastructure / adhoc |
|
44 TBuf<KMaxTextLength> SSID; |
|
45 TBuf8<KMaxTextLength> WepKey1; |
|
46 TBuf8<KMaxTextLength> WepKey2; |
|
47 TBuf8<KMaxTextLength> WepKey3; |
|
48 TBuf8<KMaxTextLength> WepKey4; |
|
49 TUint32 WepIndex; |
|
50 TUint32 SecurityMode; // SecurityMode (Allow unsecure, wep, 802.1xs, wpa) enum EWlanSecurityMode |
|
51 TUint32 WPAMode; // enum EWpaMode |
|
52 TUint32 UseWPAPSK; // CR ID: TMVI-5Y49AS |
|
53 TBuf8<KMaxPSKLength> WPAPreSharedKey; |
|
54 TUint32 AuthMode; |
|
55 TBuf<KMaxTextLength> UsedSSID; |
|
56 TUint32 ScanSSID; |
|
57 TBuf<KMaxLongTextLength> EapList; |
|
58 TBool SecondarySSIDsExisting; |
|
59 // TBuf<KMaxTextLength> SecondarySSID; |
|
60 // TBuf<KMaxTextLength> UsedSecondarySSID; |
|
61 |
|
62 }; |
|
63 |
|
64 class TSecondarySSID |
|
65 { |
|
66 public: |
|
67 TUint32 Id; |
|
68 TBuf<KMaxTextLength> ScannedId; |
|
69 TBuf<KMaxTextLength> UsedId; |
|
70 }; |
|
71 |
|
72 // ----------------------------------------------------------------------------------------------- |
|
73 // Defines |
|
74 // ----------------------------------------------------------------------------------------------- |
|
75 |
|
76 class CWlanSettings : public CBase |
|
77 { |
|
78 public: |
|
79 static CWlanSettings* NewL(CCommsDatabase& aDatabase); |
|
80 void ConstructL(); |
|
81 ~CWlanSettings(); |
|
82 |
|
83 TInt GetWlanSettings(TUint32 aLuid, TWlanSettings& aWlanSettings); |
|
84 TInt DeleteWlanSettings(TUint32 aLuid); |
|
85 TInt WriteWlanSettings(TWlanSettings& aWlanSettings); |
|
86 void ConnectToDatabaseL(); |
|
87 TInt RecordExists(TUint32 aLuid); |
|
88 TInt PerformLockWLANTablesL(TBool aProtect); |
|
89 TBool CheckEnforcementL(); |
|
90 TBool CheckAPEnforcementL(); |
|
91 TBool iWLANRelock; |
|
92 |
|
93 TInt GetEAPSettings(const TInt aId, TEapExpandedType& aExpandedId, |
|
94 TEapExpandedType& aEncapsId, EAPSettings& aEapSettings); |
|
95 TInt DeleteEAPSettings(TInt aId); |
|
96 void DeleteWlanEapSettingsL(TInt aWlanId); |
|
97 TInt DeleteSecondarySSIDsL(TUint32 aWLANId); |
|
98 TInt DeleteOneSecondarySSIDL(TUint32 aWLANId, TUint32 asecId); |
|
99 TInt WriteEAPSettings(EAPSettings& aEapSettings); |
|
100 TInt WriteSecondarySSIDL(TUint32 aWlanID, TSecondarySSID& aSettings, |
|
101 TBool aNew); |
|
102 void GetSecondarySSIDListL(TUint32 aLuid, |
|
103 RArray<TSecondarySSID>& aSecondarySSIDs); |
|
104 void GetEAPInterfaceL(const TInt aId, TEapExpandedType& aEncapsId, |
|
105 TEapExpandedType& aExpandedId); |
|
106 TInt InstalledEAPsL(CBufBase& aEAPList); |
|
107 |
|
108 private: |
|
109 |
|
110 CWlanSettings(CCommsDatabase& aDatabase); |
|
111 TInt GoToRecord(TUint32 aId); |
|
112 void GetDataFromRecordL(TWlanSettings* aWlanSettings); |
|
113 void WriteDataToRecordL(TWlanSettings* aWlanSettings); |
|
114 void InitialiseRecordL(); |
|
115 void SetSecondaryViewToRecordL(TUint32 aId); |
|
116 |
|
117 TDesC8& ConvertTo8LC(const TDesC& aSource); |
|
118 TDesC16& ConvertTo16LC(const TDesC8& aSource); |
|
119 TBool IsDisallowedInsideTTLS(const CImplementationInformation& aImplInfo); |
|
120 TBool IsDisallowedInsidePEAP(const CImplementationInformation& aImplInfo); |
|
121 TBool |
|
122 IsDisallowedOutsidePEAP( |
|
123 const CImplementationInformation& aImplInfo); |
|
124 |
|
125 CCommsDatabase& iDatabase; |
|
126 CCommsDbTableView* iTableView; |
|
127 CCommsDbTableView* iSecondaryView; |
|
128 CEapType* iEapType; |
|
129 TUint32 iServiceID; |
|
130 TBool iExpandedEAPTypeFieldsUsed; |
|
131 }; |
|
132 |
|
133 #endif __NSMLWLANSETTINGS_H__ |