wlan_plat/wlan_management_api/inc/wlanmgmtcommon.h
changeset 0 c40eb8fe8501
child 30 7d966ab5304a
child 34 13838cf40350
equal deleted inserted replaced
-1:000000000000 0:c40eb8fe8501
       
     1 /*
       
     2 * Copyright (c) 2002-2009 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:  Contains common data structures used by WLAN management service.
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: 10 %
       
    20 */
       
    21 
       
    22 #ifndef WLANMGMTCOMMON_H
       
    23 #define WLANMGMTCOMMON_H
       
    24 
       
    25 // INCLUDES
       
    26 #include <e32std.h>
       
    27 
       
    28 // LOCAL CONSTANTS
       
    29 /** The maximum SSID length. */
       
    30 const TUint KWlanMaxSsidLength = 32;
       
    31 
       
    32 /** The maximum BSSID length. */
       
    33 const TUint KWlanMaxBssidLength = 6;
       
    34 
       
    35 /** The maximum length of WPA preshared key data. */
       
    36 const TUint KWlanWpaPskMaxLength = 64;
       
    37 
       
    38 /** The maximum length of WEP key data. */
       
    39 const TUint KWlanWepKeyMaxLength = 29;
       
    40 
       
    41 /** Infinite max delay to be used in GetScanResults and GetAvailableIaps */
       
    42 const TUint KWlanInfiniteScanDelay = 0xFFFFFFFF;
       
    43 
       
    44 /** Current version of WLAN callback interface. */
       
    45 const TUint KWlanCallbackInterfaceVersion = 2;
       
    46 
       
    47 // DATA TYPES
       
    48 /** Data structure for storing the SSID of a WLAN network. */
       
    49 typedef TBuf8<KWlanMaxSsidLength> TWlanSsid;
       
    50 
       
    51 /** Data structure for storing the BSSID of a BSS. */
       
    52 typedef TBuf8<KWlanMaxBssidLength> TWlanBssid;
       
    53 
       
    54 /** Data structure for storing a WEP key. */
       
    55 typedef TBuf8<KWlanWepKeyMaxLength> TWlanWepKey;
       
    56 
       
    57 /** 
       
    58  * Data structure for storing either a WPA preshared key or passphrase.
       
    59  *
       
    60  * The WPA-PSK key can be represented either as a passphrase or as the
       
    61  * actual preshared key.
       
    62  *
       
    63  * A passphrase can contain from 8 to 63 ASCII characters where each
       
    64  * character MUST have a decimal encoding in the range of 32 to 126,
       
    65  * inclusive.
       
    66  *
       
    67  * A preshared key is stored as 64 character hex string.
       
    68  */
       
    69 typedef TBuf8<KWlanWpaPskMaxLength> TWlanWpaPresharedKey;
       
    70 
       
    71 /** Values for possible WLAN connection states. */
       
    72 enum TWlanConnectionMode
       
    73     {
       
    74     /** No connection is active. */
       
    75     EWlanConnectionModeNotConnected,
       
    76     /** Connection to an infrastructure network is active. */
       
    77     EWlanConnectionModeInfrastructure,    
       
    78     /** Connection to an ad-hoc network is active. */
       
    79     EWlanConnectionModeAdhoc,
       
    80     /** Connection to a secure infrastructure network is active. */
       
    81     EWlanConnectionModeSecureInfra,
       
    82     // Searching for an access point. No data flow.
       
    83     EWlanConnectionModeSearching
       
    84     };
       
    85 
       
    86 /** Values for possible WLAN operating modes. */
       
    87 enum TWlanOperatingMode
       
    88     {
       
    89     /** Ad-hoc network. */
       
    90     EWlanOperatingModeAdhoc,
       
    91     /** Infrastructure network. */
       
    92     EWlanOperatingModeInfrastructure
       
    93     };
       
    94 
       
    95 /** Values for possible WLAN connection security modes. */
       
    96 enum TWlanConnectionSecurityMode
       
    97     {
       
    98     /** Security mode open, i.e. no security. */
       
    99     EWlanConnectionSecurityOpen,
       
   100     /** Security mode WEP. */
       
   101     EWlanConnectionSecurityWep,
       
   102     /** Security mode 802d1x. */
       
   103     EWlanConnectionSecurity802d1x,
       
   104     /** Security mode WPA. */
       
   105     EWlanConnectionSecurityWpa,
       
   106     /** Security mode WPA PSK. */
       
   107     EWlanConnectionSecurityWpaPsk
       
   108     };
       
   109 
       
   110 /**
       
   111  * Values for possible WLAN connection security modes.
       
   112  * These are more detailed than TWlanConnectionSecurityMode.
       
   113  */
       
   114 enum TWlanConnectionExtentedSecurityMode
       
   115     {
       
   116     /** Security mode open, i.e. no security. */
       
   117     EWlanConnectionExtentedSecurityModeOpen,
       
   118     /** Security mode Open WEP. */
       
   119     EWlanConnectionExtentedSecurityModeWepOpen,
       
   120     /** Security mode Shared WEP. */
       
   121     EWlanConnectionExtentedSecurityModeWepShared,
       
   122     /** Security mode 802d1x. */
       
   123     EWlanConnectionExtentedSecurityMode802d1x,
       
   124     /** Security mode WPA. */
       
   125     EWlanConnectionExtentedSecurityModeWpa,
       
   126     /** Security mode WPA PSK. */
       
   127     EWlanConnectionExtentedSecurityModeWpaPsk,
       
   128     /** Security mode WPA2. */
       
   129     EWlanConnectionExtentedSecurityModeWpa2,
       
   130     /** Security mode WPA2 PSK. */
       
   131     EWlanConnectionExtentedSecurityModeWpa2Psk,
       
   132     /** Security mode WAPI. */
       
   133     EWlanConnectionExtentedSecurityModeWapi,
       
   134     /** Security mode WAPI PSK. */
       
   135     EWlanConnectionExtentedSecurityModeWapiPsk
       
   136     };
       
   137 
       
   138 /** Defines the possible values for IAP security mode. */
       
   139 enum TWlanIapSecurityMode
       
   140     {
       
   141     /** No encryption used. */
       
   142     EWlanIapSecurityModeAllowUnsecure,
       
   143     /** Use WEP encryption with static keys. */
       
   144     EWlanIapSecurityModeWep,
       
   145     /** Use WEP/TKIP/CCMP encryption, keys are negotiated by EAPOL. */
       
   146     EWlanIapSecurityMode802d1x,
       
   147     /** Use TKIP/CCMP encryption, keys are negotiated by EAPOL. */
       
   148     EWlanIapSecurityModeWpa,
       
   149     /** Use CCMP encryption, keys are negotiated by EAPOL. */
       
   150     EWlanIapSecurityModeWpa2Only,
       
   151     };
       
   152 
       
   153 /** Data values for RSS classes. */
       
   154 enum TWlanRssClass
       
   155     {
       
   156     /** Received signal level is 'normal'. */
       
   157     EWlanRssClassNormal,
       
   158     /** Received signal level is 'weak'. */
       
   159     EWlanRssClassWeak
       
   160     };
       
   161 
       
   162 /** Enumeration of the possible default WEP keys. */
       
   163 enum TWlanDefaultWepKey
       
   164     {
       
   165     EWlanDefaultWepKey1,            ///< Key number 1
       
   166     EWlanDefaultWepKey2,            ///< Key number 2
       
   167     EWlanDefaultWepKey3,            ///< Key number 3
       
   168     EWlanDefaultWepKey4             ///< Key number 4
       
   169     };
       
   170 
       
   171 /** Enumeration of the possible authentication modes. */
       
   172 enum TWlanAuthenticationMode
       
   173     {
       
   174     EWlanAuthenticationModeOpen,    ///< Open authentication
       
   175     EWlanAuthenticationModeShared   ///< Shared authentication
       
   176     };
       
   177 
       
   178 /** Enumaration for possible traffic stream statuses. */
       
   179 enum TWlanTrafficStreamStatus
       
   180     {
       
   181     /**
       
   182      * The traffic stream is active in the current WLAN access point.
       
   183      */
       
   184     EWlanTrafficStreamStatusActive,
       
   185     /**
       
   186      * The traffic stream is not active in the current WLAN access point
       
   187      * because the AP doesn't require admission control.
       
   188      */
       
   189     EWlanTrafficStreamStatusInactiveNotRequired,
       
   190     /**
       
   191      * The traffic stream is not active in the current WLAN access point
       
   192      * because the AP has deleted the traffic stream.
       
   193      */    
       
   194     EWlanTrafficStreamStatusInactiveDeletedByAp,
       
   195     /**
       
   196      * The traffic stream is not active in the current WLAN access point
       
   197      * because the AP has refused the traffic stream request due to
       
   198      * insufficient over-the-air bandwidth.
       
   199      */
       
   200     EWlanTrafficStreamStatusInactiveNoBandwidth,
       
   201     /**
       
   202      * The traffic stream is not active in the current WLAN access point
       
   203      * because the AP has refused the traffic stream request due to
       
   204      * invalid traffic stream parameters.
       
   205      */
       
   206     EWlanTrafficStreamStatusInactiveInvalidParameters,
       
   207     /**
       
   208      * The traffic stream is not active in the current WLAN access point
       
   209      * because the AP has refused the traffic stream request due to
       
   210      * other reasons.
       
   211      */
       
   212     EWlanTrafficStreamStatusInactiveOther
       
   213     };
       
   214 
       
   215 /** Enumeration for traffic stream direction. */
       
   216 enum TWlanTrafficStreamDirection
       
   217     {
       
   218     /** Admission is requested for uplink traffic. */ 
       
   219     EWlanTrafficStreamDirectionUplink,
       
   220     /** Admission is requested for downlink traffic. */ 
       
   221     EWlanTrafficStreamDirectionDownlink,
       
   222     /** Admission is requested for both uplink and downlink traffic. */ 
       
   223     EWlanTrafficStreamDirectionBidirectional
       
   224     };
       
   225 
       
   226 /** Enumeration for traffic stream traffic type. */
       
   227 enum TWlanTrafficStreamTrafficType
       
   228     {
       
   229     /** Traffic pattern is periodic,. */
       
   230     EWlanTrafficStreamTrafficTypePeriodic,
       
   231     /** Traffic pattern is aperiodic or unspecified. */
       
   232     EWlanTrafficStreamTrafficTypeAperiodic
       
   233     };
       
   234 
       
   235 /** Defines the possible TX rate values. */
       
   236 enum TWlanRate
       
   237 	{
       
   238 	TWlanRateNone       = 0x00000000,
       
   239 	TWlanRate1mbit      = 0x00000001,
       
   240 	TWlanRate2mbit      = 0x00000002,
       
   241 	TWlanRate5p5mbit    = 0x00000004,
       
   242 	TWlanRate6mbit      = 0x00000008,
       
   243 	TWlanRate9mbit      = 0x00000010,
       
   244 	TWlanRate11mbit     = 0x00000020,
       
   245 	TWlanRate12mbit     = 0x00000040,
       
   246 	TWlanRate18mbit     = 0x00000080,
       
   247 	TWlanRate22mbit     = 0x00000100,
       
   248 	TWlanRate24mbit     = 0x00000200,
       
   249 	TWlanRate33mbit     = 0x00000400,
       
   250 	TWlanRate36mbit     = 0x00000800,
       
   251 	TWlanRate48mbit     = 0x00001000,
       
   252 	TWlanRate54mbit     = 0x00002000
       
   253 	};
       
   254 
       
   255 /** Data structure for storing a Protected Setup credential attribute. */
       
   256 struct TWlanProtectedSetupCredentialAttribute
       
   257     {
       
   258     /** Operating mode of the network. */
       
   259     TWlanOperatingMode iOperatingMode;
       
   260     /** Authentication mode of the network. */
       
   261     TWlanAuthenticationMode iAuthenticationMode;
       
   262     /** Security mode of the network. */
       
   263     TWlanIapSecurityMode iSecurityMode;
       
   264     /** Name of the network. */
       
   265     TWlanSsid iSsid;
       
   266     /** WEP key number 1. */
       
   267     TWlanWepKey iWepKey1;
       
   268     /** WEP key number 2. */
       
   269     TWlanWepKey iWepKey2;
       
   270     /** WEP key number 3. */
       
   271     TWlanWepKey iWepKey3;
       
   272     /** WEP key number 4. */
       
   273     TWlanWepKey iWepKey4;
       
   274     /** The WEP key used by default. */
       
   275     TWlanDefaultWepKey iWepDefaultKey;
       
   276     /** WPA preshared key. */
       
   277     TWlanWpaPresharedKey iWpaPreSharedKey;
       
   278     };
       
   279 
       
   280 // CLASS DECLARATION
       
   281 /** 
       
   282  * Callback interface for WLAN management notifications.
       
   283  *
       
   284  * These virtual methods should be inherited and implemented by the
       
   285  * client wanting to observe WLAN management events.
       
   286  *
       
   287  * The client has to enable notifications by calling the appropriate
       
   288  * method from the management interface.
       
   289  * @see MWlanMgmtInterface::ActivateNotificationsL.
       
   290  * @see MWlanMgmtInterface::ActivateExtendedNotificationsL.
       
   291  * @since S60 3.0
       
   292  */
       
   293 class MWlanMgmtNotifications
       
   294     {
       
   295     public:
       
   296 
       
   297         /**
       
   298          * Connection state has changed.
       
   299          *
       
   300          * @since Callback interface v1
       
   301          * @param aNewState New connection state.
       
   302          */
       
   303         virtual void ConnectionStateChanged(
       
   304             TWlanConnectionMode /* aNewState */ ) {};
       
   305 
       
   306         /**
       
   307          * BSSID has changed (i.e. AP handover).
       
   308          *
       
   309          * @param aNewBSSID BSSID of the new access point.
       
   310          * @since Callback interface v1
       
   311          */
       
   312         virtual void BssidChanged(
       
   313             TWlanBssid& /* aNewBSSID */ ) {};
       
   314 
       
   315         /**
       
   316          * Connection has been lost.
       
   317          *
       
   318          * @since Callback interface v1
       
   319          */
       
   320         virtual void BssLost() {};
       
   321 
       
   322         /**
       
   323          * Connection has been regained.
       
   324          *
       
   325          * @since Callback interface v1
       
   326          */
       
   327         virtual void BssRegained() {};
       
   328 
       
   329         /**
       
   330          * New networks have been detected during scan.
       
   331          *
       
   332          * @since Callback interface v1
       
   333          */
       
   334         virtual void NewNetworksDetected() {};
       
   335 
       
   336         /**
       
   337          * One or more networks have been lost since the last scan.
       
   338          *
       
   339          * @since Callback interface v1
       
   340          */
       
   341         virtual void OldNetworksLost() {};
       
   342 
       
   343         /**
       
   344          * The used transmit power has been changed.
       
   345          *
       
   346          * @since Callback interface v1
       
   347          * @param aPower The transmit power in mW.
       
   348          */
       
   349         virtual void TransmitPowerChanged(
       
   350             TUint /* aPower */ ) {};
       
   351         
       
   352         /**
       
   353          * Received signal strength level has been changed.
       
   354          *
       
   355          * @since Callback interface v1
       
   356          * @param aRssClass specifies the current class of the received signal
       
   357          * @param aRss RSS level in absolute dBm values.
       
   358          */
       
   359         virtual void RssChanged(
       
   360             TWlanRssClass /* aRssClass */,
       
   361             TUint /* aRss */ ) {};
       
   362 
       
   363         /**
       
   364          * The status of a virtual traffic stream has changed.
       
   365          *
       
   366          * @since Callback interface v2
       
   367          * @param aStreamId ID of the traffic stream.
       
   368          * @param aStreamStatus Status of the traffic stream.
       
   369          */
       
   370         virtual void TrafficStreamStatusChanged(
       
   371             TUint /* aStreamId */,
       
   372             TWlanTrafficStreamStatus /* aStreamStatus */ ) {};
       
   373 
       
   374     };
       
   375 
       
   376 #endif // WLANMGMTCOMMON_H
       
   377             
       
   378 // End of File