wlan_bearer/wlanengine/wlan_symbian/wlanengine_symbian_3.1/inc/wlmclientserver.h
changeset 0 c40eb8fe8501
child 3 6524e815f76f
child 13 ab7247ff6ef9
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 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:  Data structures for client server communication in WLMServer.
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: 40 %
       
    20 */
       
    21 
       
    22 #ifndef WLMCLIENTSERVER_H
       
    23 #define WLMCLIENTSERVER_H
       
    24 
       
    25 #include "umacoidmsg.h"
       
    26 #include <wlanmgmtcommon.h>
       
    27 #include <wlanerrorcodes.h>
       
    28 #include <wdbifwlansettings.h>
       
    29 
       
    30 _LIT(KWLMServerExe,         "Z:\\system\\libs\\WLMSERVEREXE");
       
    31 _LIT(KWLMServerSemaphore,   "WLMServerSemaphore");
       
    32 _LIT(KWLMDataServerName,    "WlanServer");
       
    33 
       
    34 /** Version number */
       
    35 const TUint KWLMServMajorVersionNumber = 1;
       
    36 /** Release number */
       
    37 const TUint KWLMServMinorVersionNumber = 0;
       
    38 /** Build number */
       
    39 const TUint KWLMServBuildVersionNumber = 1;
       
    40 
       
    41 const TUint KMaxWepKeyStrLength     = 32;    // WEP max 128 bits -> 16 bytes -> 32 chars
       
    42 const TUint KMaxDBFieldLength       = 50;
       
    43 const TUint KMaxNotificationLength  = 128;   // Max data length for notification data.
       
    44 
       
    45 /**
       
    46  * The maximum number of available IAPs returned.
       
    47  */
       
    48 const TUint KWlmMaxAvailableIaps    = 64;
       
    49 
       
    50 /**
       
    51  * The maximum number of association failures before the AP is blacklisted.
       
    52  */
       
    53 const TUint KWlmMaxApFailureCount   = 5;
       
    54 
       
    55 /**
       
    56  * The maximum number of Protected Setup credentials.
       
    57  */
       
    58 const TUint KWlmProtectedSetupMaxCount = 8;
       
    59 
       
    60 /**
       
    61  * The maximum number of BSSIDs in the rogue list.
       
    62  */
       
    63 const TUint KWlmRogueListMaxCount = 10;
       
    64 
       
    65 /**
       
    66  * The maximum size of the scan list is 50kB.
       
    67  */
       
    68 const TUint KWlmScanListMaxSize = 51200;
       
    69 
       
    70 // DATA TYPES
       
    71 
       
    72 /**
       
    73 * Data values for connection states.
       
    74 */
       
    75 enum TWlanConnectionState
       
    76     {
       
    77     /** Connection is not active. No data flow. */
       
    78     EWlanStateNotConnected,
       
    79     /** Connection to access point is active. */
       
    80     EWlanStateInfrastructure,
       
    81     /** Searching access point. No data flow. */
       
    82     EWlanStateSearchingAP,
       
    83     /** AdHoc network is active. */
       
    84     EWlanStateIBSS,
       
    85     /** HW/SW/PC testing mode active. Testing only. */
       
    86     EWlanStateSecureInfra,
       
    87     /** Unknown state. */
       
    88     EConnectionStateUnknown
       
    89     };
       
    90 
       
    91 /**
       
    92 * Data values for security modes.
       
    93 */
       
    94 enum TWlanSecurity
       
    95     {
       
    96     EWlanSecurityOpen,
       
    97     EWlanSecurityWepOpen,
       
    98     EWlanSecurityWepShared,
       
    99     EWlanSecurity802d1x,
       
   100     EWlanSecurityWpa,
       
   101     EWlanSecurityWpaPsk,
       
   102     EWlanSecurityWpa2,
       
   103     EWlanSecurityWpa2Psk,
       
   104     EWlanSecurityWapi,
       
   105     EWlanSecurityWapiPsk,    
       
   106     };
       
   107 
       
   108 /**
       
   109 * Data values for system modes.
       
   110 */
       
   111 enum TWlanSystemMode
       
   112     {
       
   113     EWlanSystemNormal,
       
   114     EWlanSystemFlight,
       
   115     EWlanSystemDisabled,
       
   116     EWlanSystemStartupInProgress
       
   117     };
       
   118 
       
   119 /**
       
   120 * Data values for RSS classes.
       
   121 * These has to be in synch with TWlanRssClass and 
       
   122 * core_rss_level
       
   123 */
       
   124 enum TWlanRCPLevel
       
   125     {
       
   126     EWlanRcpNormal,
       
   127     EWlanRcpWeak
       
   128     };
       
   129 
       
   130 /**
       
   131 * Commands from client to server.
       
   132 */
       
   133 enum TWLMCommands
       
   134     {
       
   135     /** Ask server to send notifications to this session. */
       
   136     EOrderNotifications,
       
   137     /** Cancel server to stop sending notifications to this session. */
       
   138     ECancelNotifications,
       
   139     /** Get results of last access point scan. */
       
   140     EGetScanResults,
       
   141     /** Cancel an outstanding scan request. */
       
   142     ECancelGetScanResults,
       
   143     /** Join to a access point / ad hoc network by Profile id. */
       
   144     EJoinByProfileId,
       
   145     /** Cancel an outstanding join request. */
       
   146     ECancelJoin,
       
   147     /** Start an ad hoc nw / join to an ad hoc nw. */
       
   148     EStartIBSS,
       
   149     /** Reset connection. */
       
   150     EReset,
       
   151     /** Get available WLAN IAPs. */
       
   152     EGetAvailableIaps,
       
   153     /** Cancel an outstanding IAP availability request. */
       
   154     ECancelGetAvailableIaps,
       
   155     /** Get current state of the connection. */
       
   156     EGetCurrentState,
       
   157     /** Get current signal strength, 0 if no connection. */
       
   158     EGetCurrentRSSI,
       
   159     /** Get the MAC address of AP/STA that is being connected to. */
       
   160     EGetMacAddress,
       
   161     /** Get the name of the current network. */
       
   162     EGetNetworkName,
       
   163     /** Get the current security mode. */
       
   164     EGetSecurityMode,
       
   165     /** Get the current system mode. */
       
   166     EGetSystemMode,
       
   167     /** Notify the server about changed settings. */
       
   168     ENotifyChangedSettings,
       
   169     /** Add BSSID to roguelist (blacklist) */
       
   170     EAddBssidToRoguelist,
       
   171     /** Update RCP notification boundaries */
       
   172     EUpdateRcpNotificationBoundaries,
       
   173     /** Configure multicast address */
       
   174     EConfigureMulticastGroup,
       
   175     /** Get packet statistics of the current connection. */
       
   176     EGetPacketStatistics,
       
   177     /** Clear packet statistics of the current connection. */
       
   178     EClearPacketStatistics,
       
   179     /** Get the current U-APSD settings. */
       
   180     EGetUapsdSettings,
       
   181     /** Set the U-APSD settings. */
       
   182     ESetUapsdSettings,
       
   183     /** Get the current power save settings. */
       
   184     EGetPowerSaveSettings,
       
   185     /** Set the power save settings. */
       
   186     ESetPowerSaveSettings,
       
   187     /** Run Protected setup */
       
   188     ERunProtectedSetup,
       
   189     /** Cancel Protected setup */
       
   190     ECancelProtectedSetup,
       
   191     /** Request creation of a traffic stream. */
       
   192     ECreateTrafficStream,
       
   193     /** Cancel a pending traffic stream creation request. */
       
   194     ECancelCreateTrafficStream,
       
   195     /** Request deletion of a traffic stream. */
       
   196     EDeleteTrafficStream,
       
   197     /** Cancel a pending traffic stream deletion request. */
       
   198     ECancelDeleteTrafficStream,
       
   199     /** Get information about the current AP. */
       
   200     EGetAccessPointInfo,
       
   201     /** Get roam metrics of the current connection. */
       
   202     EGetRoamMetrics,
       
   203     /** Get a list of BSSIDs on the rogue list. */
       
   204     EGetRogueList,
       
   205     /** Get the current regulatory domain. */
       
   206     EGetRegulatoryDomain,
       
   207     /** Get the current power save mode. */
       
   208     EGetPowerSaveMode,
       
   209     /** Add a list of SSIDs to an IAP. */
       
   210     EAddIapSsidList,
       
   211     /** Remove any list of SSIDs attached to an IAP. */ 
       
   212     ERemoveIapSsidList,
       
   213     /** Set the power save mode. */
       
   214     ESetPowerSaveMode,
       
   215     /** Notify the server about changed PSM server mode. */
       
   216     ENotifyChangedPsmSrvMode,
       
   217     /** Get the current traffic status for access classes. */
       
   218     EGetAcTrafficStatus,
       
   219     /** Initiate a roam to the given BSSID. */
       
   220     EDirectedRoam,
       
   221     /** Cancel a pending directed roam request. */
       
   222     ECancelDirectedRoam
       
   223     };
       
   224 
       
   225 /**
       
   226 * Nofications from server to client.
       
   227 */
       
   228 enum TWlmNotify
       
   229     {
       
   230     EWlmNotifyNone                          = 0x0000,
       
   231     EWlmNotifyConnectionStateChanged        = 0x0001,
       
   232     EWlmNotifyBssidChanged                  = 0x0002,
       
   233     EWlmNotifyBssLost                       = 0x0004,
       
   234     EWlmNotifyBssRegained                   = 0x0008,
       
   235     EWlmNotifyNewNetworksDetected           = 0x0010,
       
   236     EWlmNotifyOldNetworksLost               = 0x0020,
       
   237     EWlmNotifyTransmitPowerChanged          = 0x0040,
       
   238     EWlmNotifyNotificationsCancelled        = 0x0080,
       
   239     EWlmNotifyRcpChanged                    = 0x0100,
       
   240     EWlmNotifyTrafficStreamStatusChanged    = 0x0200,
       
   241     EWlmNotifyAccessPointInfoChanged        = 0x0400,
       
   242     EWlmNotifyRcpiRoamAttemptStarted        = 0x0800,
       
   243     EWlmNotifyRcpiRoamAttemptCompleted      = 0x1000,
       
   244     EWlmNotifyBrokenPowerSaveTestFailed     = 0x2000,
       
   245     EWlmNotifyAcTrafficModeChanged          = 0x4000,
       
   246     EWlmNotifyAcTrafficStatusChanged        = 0x8000
       
   247     };
       
   248 
       
   249 /**
       
   250  * Default notifications for callback API v1.
       
   251  */
       
   252 const TUint32 KWlmDefaultNotificationsV1 =
       
   253     EWlmNotifyConnectionStateChanged |
       
   254     EWlmNotifyBssidChanged |
       
   255     EWlmNotifyBssLost |
       
   256     EWlmNotifyBssRegained |
       
   257     EWlmNotifyNewNetworksDetected |
       
   258     EWlmNotifyOldNetworksLost |
       
   259     EWlmNotifyTransmitPowerChanged |
       
   260     EWlmNotifyNotificationsCancelled |
       
   261     EWlmNotifyRcpChanged;
       
   262 
       
   263 /**
       
   264  * Default notifications for callback API v2.
       
   265  */
       
   266 const TUint32 KWlmDefaultNotificationsV2 =
       
   267     KWlmDefaultNotificationsV1 |
       
   268     EWlmNotifyTrafficStreamStatusChanged;
       
   269 
       
   270 /**
       
   271 * Notifications' data.
       
   272 */
       
   273 struct TWlmNotifyData
       
   274     {
       
   275     TBuf8<KMaxNotificationLength> data;
       
   276     };
       
   277 
       
   278 /**
       
   279 * Bit mask for overrided settings.
       
   280 */
       
   281 enum TOverrideSettingsMask
       
   282     {
       
   283     EOverrideNoneMask   = 0x00000000,
       
   284     EOverrideSsidMask   = 0x00000001,
       
   285     EOverrideBssidMask  = 0x00000002,
       
   286 	EOverrideWepMask	= 0x00000004,
       
   287 	EOverrideWpaPskMask = 0x00000008,
       
   288 	EOverrideWpaMask	= 0x00000010, /** Use WPA handshake, if bit defined. */
       
   289 	EOverrideIbssMask	= 0x00000020  /** Use IBSS mode, if bit defined. */
       
   290     };
       
   291 
       
   292 /**
       
   293  * The possible statuses of a traffic stream.
       
   294  */
       
   295 enum TWlmTrafficStreamStatus
       
   296     {
       
   297     /**
       
   298      * The traffic stream has been successfully created.
       
   299      */
       
   300     EWlmTrafficStreamStatusActive,
       
   301     /**
       
   302      * The traffic stream has either been deleted by the network or
       
   303      * the new AP after roaming no longer requires admission control.
       
   304      */      
       
   305     EWlmTrafficStreamStatusNotActive,
       
   306     /**
       
   307      * The current AP has rejected our request to create a traffic
       
   308      * stream. Stream creation must not be retried until we have
       
   309      * roamed to a new AP.
       
   310      */
       
   311     EWlmTrafficStreamStatusRejected
       
   312     };
       
   313 
       
   314 /**
       
   315  * The possible statuses of a PSM mode.
       
   316  */
       
   317 enum TWlanPsmMode
       
   318     {
       
   319     /**
       
   320      * Normal PSM power save mode.
       
   321      */
       
   322     EWlmPsmModeNormal = 0,
       
   323     /**
       
   324      * Full PSM power save mode.
       
   325      */      
       
   326     EWlmPsmModePowerSave,
       
   327     /**
       
   328      * Partial PSM power save mode.
       
   329      */
       
   330     EWlmPsmPartialMode
       
   331     };
       
   332 
       
   333 /**
       
   334  * The possible access classes.
       
   335  */
       
   336 enum TWlmAccessClass
       
   337     {
       
   338     EWlmAccessClassBestEffort = 0,
       
   339     EWlmAccessClassBackground = 1,
       
   340     EWlmAccessClassVideo = 2,
       
   341     EWlmAccessClassVoice = 3,
       
   342     EWlmAccessClassMax = 4
       
   343     };
       
   344 
       
   345 /**
       
   346  * Definitions for possible traffic modes for an access class.
       
   347  */
       
   348 enum TWlmAcTrafficMode
       
   349     {
       
   350     /** Automatic traffic stream creation is allowed. */    
       
   351     EWlmAcTrafficModeAutomatic,
       
   352     /** Automatic traffic stream creation is NOT allowed. */
       
   353     EWlmAcTrafficModeManual
       
   354     };
       
   355 
       
   356 /**
       
   357  * Definitions for possible traffic statuses for an access class.
       
   358  */
       
   359 enum TWlmAcTrafficStatus
       
   360     {
       
   361     /**
       
   362      * Traffic for this access class has been admitted.
       
   363      */
       
   364     EWlmAcTrafficStatusAdmitted,
       
   365     /** 
       
   366      * Traffic for this access class has NOT been admitted,
       
   367      * traffic needs to be downgraded to a lower access class.
       
   368      */
       
   369     EWlmAcTrafficStatusNotAdmitted
       
   370     };
       
   371 
       
   372 typedef TFixedArray<TWlmAcTrafficStatus, EWlmAccessClassMax> TWlmAcTrafficStatusArray;
       
   373 
       
   374 /**
       
   375 * Data structure for join overrides.
       
   376 */
       
   377 struct TWLMOverrideSettings
       
   378     {
       
   379     /** See TOverrideSettingsMask */
       
   380     TUint32 settingsMask;
       
   381     /** Override SSID. Used in easy connection. */
       
   382     TSSID ssid;
       
   383     /** Override BSSID. Used in test cases only. */
       
   384     TMacAddress bssid;
       
   385 	/** Override WEP key. Used in easy connection. */
       
   386 	TWep wep;
       
   387 	/** Override WPA Pre-Shared Key. Used in easy connection. */
       
   388 	TWpaPsk wpaPsk;
       
   389     };
       
   390 
       
   391 /**
       
   392 * Data structure sending TMacAddress as a TPckg.
       
   393 */
       
   394 struct TMacPckg
       
   395     {
       
   396     TMacAddress data;
       
   397     };
       
   398 
       
   399 /**
       
   400 * Data structure for storing available IAP IDs.
       
   401 */  
       
   402 struct TWlmAvailableIaps
       
   403     {
       
   404     /** The number of IAPs available. */
       
   405     TUint32 count;
       
   406     
       
   407     /** The available IAP IDs. */
       
   408     TFixedArray<TUint,KWlmMaxAvailableIaps> iaps;
       
   409     };
       
   410 
       
   411 /**
       
   412  * Structure for storing traffic stream parameters.
       
   413  */
       
   414 struct TWlmTrafficStreamParams
       
   415     {
       
   416     /**
       
   417      * Whether the traffic pattern is periodic or aperiodic.
       
   418      */
       
   419     TBool isPeriodicTraffic;     
       
   420     /**
       
   421      * The current value of Nominal MSDU Size.
       
   422      */
       
   423     TUint16 nomimalMsduSize;
       
   424     /**
       
   425      * The current value of Maximum MSDU Size.
       
   426      */
       
   427     TUint16 maximumMsduSize;
       
   428     /**
       
   429      * The current value of Minimum Service Interval.
       
   430      */        
       
   431     TUint32 minimumServiceInterval;
       
   432     /**
       
   433      * The current value of Maximum Service Interval.
       
   434      */   
       
   435     TUint32 maximumServiceInterval;
       
   436     /**
       
   437      * The current value of Inactivity Interval.
       
   438      */    
       
   439     TUint32 inactivityInterval;
       
   440     /**
       
   441      * The current value of Suspension Interval.
       
   442      */    
       
   443     TUint32 suspensionInterval;
       
   444     /**
       
   445      * The current value of Service Start Time.
       
   446      */    
       
   447     TUint32 serviceStartTime;
       
   448     /**
       
   449      * The current value of Minimum Data Rate.
       
   450      */
       
   451     TUint32 minimumDataRate;
       
   452     /**
       
   453      * The current value of Mean Data Rate.
       
   454      */    
       
   455     TUint32 meanDataRate;
       
   456     /**
       
   457      * The current value of Peak Data Rate.
       
   458      */    
       
   459     TUint32 peakDataRate;
       
   460     /**
       
   461      * The current value of Maximum Burst Size.
       
   462      */    
       
   463     TUint32 maximumBurstSize;
       
   464     /**
       
   465      * The current value of Delay Bound
       
   466      */    
       
   467     TUint32 delayBound;
       
   468     /**
       
   469      * The current value of Minimum PHY Rate.
       
   470      */    
       
   471     TUint32 minimumPhyRate;
       
   472     /**
       
   473      * The current value of Bandwidth Allowance.
       
   474      */    
       
   475     TUint16 surplusBandwithAllowance;
       
   476     /**
       
   477      * The current value of Medium Time.
       
   478      */    
       
   479     TUint16 mediumTime;
       
   480     };
       
   481 
       
   482 
       
   483 /**
       
   484  * Data structure for storing available Protected setup credentials.
       
   485  */  
       
   486 struct TWlmProtectedSetupCredentials
       
   487     {
       
   488     /** The number of IAPs available. */
       
   489     TUint32 count;
       
   490 
       
   491     /** The available IAP IDs. */
       
   492     TFixedArray<TWlanProtectedSetupCredentialAttribute, KWlmProtectedSetupMaxCount> credentials;
       
   493     };
       
   494 
       
   495 /**
       
   496  * Data structure for storing a list of BSSIDs on the rogue list.
       
   497  */
       
   498 struct TWlmRogueList
       
   499     {
       
   500     /** The number of BSSIDs on the rogue list. */
       
   501     TUint32 count;
       
   502 
       
   503     /** BSSID list. */
       
   504     TFixedArray<TWlanBssid, KWlmRogueListMaxCount> list;
       
   505     };
       
   506 
       
   507 
       
   508 /**
       
   509  * Structure for storing limited information about an IAP.
       
   510  */
       
   511 struct TWlanLimitedIapData
       
   512     {
       
   513     TUint iapId;
       
   514     TUint serviceId;
       
   515     TBuf8<KMaxSSIDLength> ssid;
       
   516     TBuf8<KMaxSSIDLength> usedSsid;
       
   517     EConnectionMode networkType;
       
   518     EWlanSecurityMode securityMode;
       
   519     TBool isPskEnabled;
       
   520     TBool isHidden;
       
   521     };    
       
   522 
       
   523 /**
       
   524  * Data structure for storing dynamic scan list parameters.
       
   525  */
       
   526 struct TDynamicScanList
       
   527     {
       
   528     TUint32 count;
       
   529     TUint32 size;
       
   530     };
       
   531 
       
   532 /**
       
   533  * Data structure for storing scan scheduling parameters.
       
   534  */
       
   535 struct TScanScheduling
       
   536     {
       
   537     TInt cacheLifetime;
       
   538     TUint maxDelay;
       
   539     };
       
   540 
       
   541 #endif // WLMCLIENTSERVER_H