hotspotfw/hsserver/inc/hotspotclientserver.h
changeset 0 56b72877c1cb
child 8 c2bc3f8c7777
child 19 10810c91db26
equal deleted inserted replaced
-1:000000000000 0:56b72877c1cb
       
     1 /*
       
     2 * Copyright (c) 2002-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 "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.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef HOTSPOTCLIENTSERVER_H
       
    21 #define HOTSPOTCLIENTSERVER_H
       
    22 
       
    23 #include "hssiapsettings.h"
       
    24 
       
    25 _LIT(KHotSpotServerExe,         "\\sys\\bin\\HotSpotServer.exe");
       
    26 _LIT(KHotSpotServerSemaphore,   "HotSpotServerSemaphore");
       
    27 _LIT(KHotSpotDataServerName,    "HotSpotServer");
       
    28 
       
    29 _LIT( KWlanBearerAgent, "wlanagt.agt" );
       
    30 _LIT( KWlanBearerAgent2, "wlanagt2.agt" );
       
    31 
       
    32 _LIT(KHotSpotServerName,"hotspotserver");
       
    33 _LIT(KHotSpotServerImg,"HotSpotServer");		// DLL/EXE name
       
    34 
       
    35 _LIT(KExePath, "\\sys\\bin\\");
       
    36 _LIT(KExe, ".exe");
       
    37 
       
    38 _LIT( KHotSpotPlugin, "NetCfgExtnHotSpot" );
       
    39 _LIT( KDhcpPlugin, "NetCfgExtnDhcp" );
       
    40 const TUint KEasyWlanServiceId = 1;
       
    41 
       
    42 const TUint KMaxSqlQueryLength = 2048;
       
    43 _LIT(KDatabaseName, "c:\\system\\data\\hotspot.dat");
       
    44 _LIT(KTableName, "hotspot");
       
    45 _LIT(KIapName, "IapName");
       
    46 _LIT(KTestStatus, "TestStatus");
       
    47 _LIT(KRedirectStatus, "RedirectStatus");
       
    48 
       
    49 const TInt KAppNameMaxLength = 64;
       
    50 const TInt KExePathLength = 14;
       
    51 const TInt KExeLength = 4;
       
    52 const TUid KHotspotServerUid3={0x10282ECB};
       
    53 
       
    54 const TInt KMaxHotspotMessage=512;
       
    55 const TInt KScanHotspotIapId=0;
       
    56 
       
    57 const TUint KHssShutdown  = 777;
       
    58 
       
    59 const TUid KInternetConnectivityUid={0x10282EC5};
       
    60 const TUid K3rdPartyEcomInterfaceUid={0x10282ED1};
       
    61 
       
    62 _LIT8( KExtensionAPI, " HSFWExt" );
       
    63 _LIT8( KUidPrefix, "0x" );
       
    64 const TInt KExtensionAPILength = 32;
       
    65 
       
    66 /**
       
    67  * Number of message slots in the server.
       
    68  * Needed message slots can be defined as follows:
       
    69  * total slots = n+2, where n is number of independent
       
    70  * asynchronous services offered by the server.
       
    71  */
       
    72 const TUint KDefaultMsgSlots        = 6;
       
    73 
       
    74 //the server version. A version must be specifyed when creating a session with the server
       
    75 const TUint KHotSpotMajorVersionNumber = 0;
       
    76 const TUint KHotSpotMinorVersionNumber = 1;
       
    77 const TUint KHotSpotBuildVersionNumber = 1;
       
    78 
       
    79 const TInt KIapNameLength = 128;
       
    80 const TUint KConnectivityTestedId = 20;
       
    81 const TUint KConnectivityTestNeededId = 30;
       
    82 const TUint KNoRedirect = 40;
       
    83 const TUint KRedirect = 50;
       
    84 
       
    85 /**
       
    86 * Commands from client to server.
       
    87 */
       
    88 enum THotSpotCommands
       
    89     {
       
    90     // Client API 
       
    91     EHssGetScanResults,
       
    92     EHssRegister,
       
    93     EHssUnRegister,
       
    94     EHssJoin,
       
    95     EHssCancelStart,
       
    96     EHssStop,
       
    97     EHssLoginComplete,
       
    98     EHssLogoutComplete,
       
    99     EHssActivateNotifications,
       
   100     EHssCancelNotifications,
       
   101     EHssSetTimerValues,
       
   102     // WLAN Agent API
       
   103 	EHssStart,
       
   104 	EHssStartAgain,
       
   105 	EHssCloseConnection,
       
   106 	EHssCancel,
       
   107     // NIFMAN Config API
       
   108     EHssStartLogin,
       
   109     EHssCancelLogin,
       
   110     // Shutdown API
       
   111     EHssServerShutdown,
       
   112     // Internal
       
   113     EHssGetIAP,
       
   114     // UI API
       
   115     EHssUiState,
       
   116     // ICTS API
       
   117     EHssStartBrowser
       
   118     };
       
   119 
       
   120 class TIapName
       
   121     {
       
   122     public:
       
   123         inline void SetIapName( const TDesC& aIapName )
       
   124             {
       
   125             iIapName = aIapName;
       
   126             };
       
   127         inline TDesC& IapName()
       
   128             {
       
   129             return iIapName;
       
   130             };
       
   131     private:
       
   132         TBufC< KIapNameLength > iIapName;
       
   133         
       
   134     };
       
   135 
       
   136 class TClientUid
       
   137     {
       
   138     public:
       
   139         inline void SetUid( const TUid aUid )
       
   140             {
       
   141             iUid = aUid;
       
   142             };
       
   143         inline TUid ClientUid()
       
   144             {
       
   145             return iUid;
       
   146             };
       
   147     private:
       
   148         TUid iUid;
       
   149         
       
   150     };
       
   151 
       
   152 class TIapSettings
       
   153     {
       
   154     public:
       
   155         inline void SetIapSettings( const THssIapSettings& aIapSettings )
       
   156             {
       
   157             iIapSettings = aIapSettings;
       
   158             };
       
   159         inline THssIapSettings& IapSettings()
       
   160             {
       
   161             return iIapSettings;
       
   162             };
       
   163     private:
       
   164         THssIapSettings iIapSettings;
       
   165         
       
   166     };
       
   167     
       
   168 /**
       
   169  * Data values for security modes.
       
   170  */
       
   171 enum THssSecurity
       
   172     {
       
   173     EHssSecurityOpen,
       
   174     EHssSecurityWep,
       
   175     EHssSecurity802d1x,
       
   176     EHssSecurityWpa,
       
   177     EHssSecurityWpaPsk,
       
   178     EHssSecurityWpa2,
       
   179     EHssSecurityWpa2Psk
       
   180     };
       
   181 
       
   182 /**
       
   183 * Nofications from server to client.
       
   184 */
       
   185 enum THssResponses
       
   186     {
       
   187     EHssNewNetworksDetected,
       
   188     EHssOldNetworksLost
       
   189     };
       
   190 
       
   191 /**
       
   192 * Hotspot Browser UI states.
       
   193 */
       
   194 enum THsBrowserUiStates
       
   195     {
       
   196     EHsBrowserUiUndefined,
       
   197     EHsBrowserUiRunning,
       
   198     EHsBrowserUiAuthenticatedOk,
       
   199     EHsBrowserUiAuthenticatedNok,
       
   200     EHsBrowserUiClosed
       
   201     };
       
   202 
       
   203 #endif // HOTSPOTCLIENTSERVER_H