omadm/omadmextensions/adapters/nsmldinternet/inc/NSmlWlanSettings.h
changeset 1 4490afcb47b1
child 17 bcecc171137b
equal deleted inserted replaced
0:3ce708148e4d 1:4490afcb47b1
       
     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 
       
    19 
       
    20 #ifndef __NSMLWLANSETTINGS_H__
       
    21 #define __NSMLWLANSETTINGS_H__
       
    22 
       
    23 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    24 #include <commsdat_partner.h>
       
    25 #endif
       
    26 #include <commdb.h>
       
    27 #include <commsdattypesv1_1.h>
       
    28 #include <EapType.h>
       
    29 
       
    30 const TInt KMaxPSKLength = 63;
       
    31 const TInt KMinPSKLength = 8;
       
    32 
       
    33 // ==========================================================================
       
    34 // Class forwards
       
    35 // ==========================================================================
       
    36 //
       
    37 class CWlanSettings;
       
    38 
       
    39 class TWlanSettings
       
    40     {
       
    41 public:    
       
    42     TBuf<KMaxTextLength>     Name;
       
    43     TUint32                  Id;
       
    44     TUint32                  ServiceID;
       
    45     TUint32                  ConnectionMode;     // Infrastructure / adhoc
       
    46     TBuf<KMaxTextLength>     SSID;           
       
    47     TBuf8<KMaxTextLength>    WepKey1; 
       
    48     TBuf8<KMaxTextLength>    WepKey2;
       
    49     TBuf8<KMaxTextLength>    WepKey3;
       
    50     TBuf8<KMaxTextLength>    WepKey4;
       
    51     TUint32                  WepIndex;
       
    52     TUint32                  SecurityMode;   // SecurityMode (Allow unsecure, wep, 802.1xs, wpa) enum EWlanSecurityMode
       
    53     TUint32                  WPAMode;        // enum EWpaMode
       
    54     TUint32                  UseWPAPSK;      // CR ID: TMVI-5Y49AS
       
    55     TBuf8<KMaxPSKLength>    WPAPreSharedKey;  
       
    56     TUint32				     AuthMode;
       
    57     TBuf<KMaxTextLength>     UsedSSID;           
       
    58     TUint32                  ScanSSID;           
       
    59     TBuf<KMaxLongTextLength> EapList;
       
    60     TBool                       SecondarySSIDsExisting;
       
    61 //    TBuf<KMaxTextLength>        SecondarySSID;
       
    62 //    TBuf<KMaxTextLength>        UsedSecondarySSID;
       
    63 
       
    64     };
       
    65             
       
    66 class TSecondarySSID
       
    67     {
       
    68 public:
       
    69     TUint32                 Id;
       
    70     TBuf<KMaxTextLength>   ScannedId;
       
    71     TBuf<KMaxTextLength>   UsedId;
       
    72     };    
       
    73 
       
    74 
       
    75 // -----------------------------------------------------------------------------------------------
       
    76 // Defines
       
    77 // -----------------------------------------------------------------------------------------------
       
    78 
       
    79 class CWlanSettings : public CBase
       
    80     {
       
    81 public:
       
    82     static CWlanSettings* NewL( CCommsDatabase& aDatabase );
       
    83     void ConstructL( );
       
    84     ~CWlanSettings( );
       
    85 
       
    86     TInt GetWlanSettings( TUint32 aLuid, TWlanSettings& aWlanSettings );
       
    87     TInt DeleteWlanSettings( TUint32 aLuid );
       
    88     TInt WriteWlanSettings( TWlanSettings& aWlanSettings );
       
    89     void ConnectToDatabaseL( );
       
    90     TInt RecordExists( TUint32 aLuid );
       
    91     TInt PerformLockWLANTablesL(TBool aProtect);
       
    92     TBool CheckEnforcementL();
       
    93     TBool CheckAPEnforcementL();
       
    94     TBool iWLANRelock;
       
    95     
       
    96     TInt GetEAPSettings( const TInt aId, const TInt aEapType, const TInt aTunnelingType, EAPSettings& aEapSettings );
       
    97     TInt DeleteEAPSettings( TInt aId , TInt aEapType  );
       
    98     void DeleteWlanEapSettingsL( TInt aWlanId );
       
    99     TInt DeleteSecondarySSIDsL( TUint32 aWLANId );
       
   100     TInt DeleteOneSecondarySSIDL( TUint32 aWLANId , TUint32 asecId);
       
   101     TInt WriteEAPSettings( EAPSettings& aEapSettings);
       
   102     TInt WriteSecondarySSIDL( TUint32 aWlanID, TSecondarySSID& aSettings, TBool aNew );
       
   103     void GetSecondarySSIDListL(TUint32 aLuid, RArray<TSecondarySSID>& aSecondarySSIDs);
       
   104     void GetEAPInterfaceL(const TInt aId, const TInt aTunnelingType, const TInt aType);
       
   105     TInt InstalledEAPsL(CBufBase& aEAPList);
       
   106 	
       
   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 
       
   120     CCommsDatabase& iDatabase;
       
   121     CCommsDbTableView* iTableView;
       
   122     CCommsDbTableView* iSecondaryView;
       
   123     CEapType* iEapType;
       
   124     TUint32 iServiceID;
       
   125     TBool iExpandedEAPTypeFieldsUsed;
       
   126     };
       
   127 
       
   128 
       
   129 #endif __NSMLWLANSETTINGS_H__