# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1276070020 -10800 # Node ID aaabc7526dedae8d7b2a836f5978980f617a8bae # Parent 024ee8b21fe252faad8f072409b33af79cb5e274 Revision: 201021 Kit: 2010123 diff -r 024ee8b21fe2 -r aaabc7526ded hotspotfw/hsserver/src/hotspotserver.cpp --- a/hotspotfw/hsserver/src/hotspotserver.cpp Tue May 25 13:53:32 2010 +0300 +++ b/hotspotfw/hsserver/src/hotspotserver.cpp Wed Jun 09 10:53:40 2010 +0300 @@ -213,6 +213,10 @@ TBool supportedBearersOnly = ETrue; TBool legacyCmsOnly = EFalse; + // Read Easy WLAN IAP ID first + iEasyWlanId = cmManager.EasyWlanIdL(); + DEBUG1("CHotSpotServer::FindClientIapsL() iEasyWlanId: % d", iEasyWlanId); + cmManager.ConnectionMethodL( cmArray, supportedBearersOnly, legacyCmsOnly ); DEBUG1("CHotSpotServer::FindClientIapsL count: %d", cmArray.Count()); @@ -243,11 +247,8 @@ CleanupStack::PopAndDestroy( &cm ); } CleanupStack::PopAndDestroy( &cmArray ); - - // Read Easy WLAN IAP ID - iEasyWlanId = cmManager.EasyWlanIdL(); CleanupStack::PopAndDestroy( &cmManager ); - DEBUG1("CHotSpotServer::FindClientIapsL() iEasyWlanId: % d", iEasyWlanId); + DEBUG("CHotSpotServer::FindClientIapsL() Done"); } // ----------------------------------------------------------------------------- diff -r 024ee8b21fe2 -r aaabc7526ded hotspotfw/hsserver/src/hotspotsession.cpp --- a/hotspotfw/hsserver/src/hotspotsession.cpp Tue May 25 13:53:32 2010 +0300 +++ b/hotspotfw/hsserver/src/hotspotsession.cpp Wed Jun 09 10:53:40 2010 +0300 @@ -625,35 +625,34 @@ switch ( aResult ) { case EConnectionOk : - indx = iServer.FindMessage( iIapId, EHssStartLogin ); - if ( KErrNotFound != indx ) - { - iServer.CompleteMessage( indx, KErrNone ); - } - TRAPD( trap, iIapSettingsHandler->CreateIapL() ); - if ( trap != KErrNone ) - { - DEBUG1("CHotSpotSession::ConnectivityObserver trap: %d", trap); - } - break; - case EHttpAuthenticationNeeded : - // Start browser for authentication - TRAP_IGNORE( AuthenticateL( aString ) ); - break; - case EConnectionNotOk : + // Create IAP first, then complete the message to connection. + TRAP_IGNORE( iIapSettingsHandler->CreateIapL() ); indx = iServer.FindMessage( iIapId, EHssStartLogin ); if ( KErrNotFound != indx ) { iServer.CompleteMessage( indx, KErrNone ); } break; + case EHttpAuthenticationNeeded : + // Start browser for authentication + TRAPD( browserStarted, AuthenticateL( aString ) ); + if ( browserStarted != KErrNone ) + { + // Starting of browser leaved. Complete the message. + indx = iServer.FindMessage( iIapId, EHssStartLogin ); + if ( KErrNotFound != indx ) + { + iServer.CompleteMessage( indx, KErrNone ); + } + } + break; + case EConnectionNotOk : case ETimeout : indx = iServer.FindMessage( iIapId, EHssStartLogin ); if ( KErrNotFound != indx ) { iServer.CompleteMessage( indx, KErrNone ); } - break; default: break; diff -r 024ee8b21fe2 -r aaabc7526ded hotspotfw/internetconnectivitytestservice/inc/ictshttphandler.h --- a/hotspotfw/internetconnectivitytestservice/inc/ictshttphandler.h Tue May 25 13:53:32 2010 +0300 +++ b/hotspotfw/internetconnectivitytestservice/inc/ictshttphandler.h Wed Jun 09 10:53:40 2010 +0300 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: Contains implementation for HTTP::HEAD test +* Description: Contains implementation for connectivity test with HTTP * */ @@ -31,12 +31,12 @@ /** * Handles HTTP related things. * - * Sends HTTP::HEAD and interact with HTTP FW. Returns results to - * caller. + * Sends HTTP GET using HTTP FW. Returns results to the caller. * * @lib ictsclientinterface.lib */ -class CIctsHttpHandler : public CTimer, public MHTTPTransactionCallback +class CIctsHttpHandler : public CTimer, + public MHTTPTransactionCallback { public: @@ -53,7 +53,7 @@ virtual ~CIctsHttpHandler(); /** - * Send HTTP::HEAD request + * Send HTTP GET request * * @param aIPAddress IP address * @param aIapID IAP id @@ -61,11 +61,11 @@ * @return KErrNone if successful */ TInt SendHttpRequestL( TDesC8& aIPAddress, - TUint32 aIapID, - TUint32 aNetworkId ); + TUint32 aIapID, + TUint32 aNetworkId ); /** - * Cancels HTTP::HEAD request + * Cancels HTTP GET request * * @return None */ @@ -94,7 +94,6 @@ virtual TInt MHFRunError( TInt aError, RHTTPTransaction aTransaction, const THTTPEvent& aEvent); - protected: // Functions from base classes @@ -126,7 +125,7 @@ * @return None */ void SetHttpConnectionInfoL( RConnection& aConnection, - RSocketServ& aSocketServ ); + RSocketServ& aSocketServ ); /** * Send HTTP request * @@ -142,6 +141,14 @@ * @return ETrue if found, else EFalse */ TBool CheckHttp( TDesC8& aIPAddress ); + + /** + * Checks if HTTP status code is a redirect (301,302,303,307) + * + * @param aTransaction HTTP transactionL + * @return ETrue if found, else EFalse + */ + TBool CheckStatusCodeL( RHTTPTransaction aTransaction ); private: // data diff -r 024ee8b21fe2 -r aaabc7526ded hotspotfw/internetconnectivitytestservice/src/ictshttphandler.cpp --- a/hotspotfw/internetconnectivitytestservice/src/ictshttphandler.cpp Tue May 25 13:53:32 2010 +0300 +++ b/hotspotfw/internetconnectivitytestservice/src/ictshttphandler.cpp Wed Jun 09 10:53:40 2010 +0300 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: HTTP class for HTTP::HEAD testing +* Description: Class for HTTP GET testing * */ @@ -33,9 +33,9 @@ const TInt KFound = 302; const TInt KSeeOther = 303; const TInt KTemporaryRedirect = 307; + // ======== MEMBER FUNCTIONS ======== - // --------------------------------------------------------------------------- // CIctsHttpHandler::CIctsHttpHandler // C++ default constructor can NOT contain any code, that @@ -76,7 +76,8 @@ TInt aHttpResponseTime ) { DEBUG("CIctsHttpHandler::NewL()"); - CIctsHttpHandler* self = new( ELeave ) CIctsHttpHandler( aOwner, aHttpResponseTime ); + CIctsHttpHandler* self = new( ELeave ) CIctsHttpHandler( aOwner, + aHttpResponseTime ); CleanupStack::PushL( self ); self->ConstructL(); CleanupStack::Pop( self ); @@ -126,42 +127,47 @@ RHTTPConnectionInfo connInfo = iHttpSession.ConnectionInfo(); // Clear RConnection and Socket Server instances - connInfo.RemoveProperty(strPool.StringF(HTTP::EHttpSocketServ,RHTTPSession::GetTable())); - connInfo.RemoveProperty(strPool.StringF(HTTP::EHttpSocketConnection,RHTTPSession::GetTable())); + connInfo.RemoveProperty( strPool.StringF( HTTP::EHttpSocketServ, + RHTTPSession::GetTable() ) ); + connInfo.RemoveProperty( strPool.StringF( HTTP::EHttpSocketConnection, + RHTTPSession::GetTable() ) ); // Clear the proxy settings - THTTPHdrVal proxyUsage(strPool.StringF(HTTP::EUseProxy,RHTTPSession::GetTable())); - connInfo.RemoveProperty(strPool.StringF(HTTP::EProxyUsage,RHTTPSession::GetTable())); - connInfo.RemoveProperty(strPool.StringF(HTTP::EProxyAddress,RHTTPSession::GetTable())); + THTTPHdrVal proxyUsage( strPool.StringF( HTTP::EUseProxy, + RHTTPSession::GetTable() ) ); + connInfo.RemoveProperty( strPool.StringF( HTTP::EProxyUsage, + RHTTPSession::GetTable() ) ); + connInfo.RemoveProperty( strPool.StringF( HTTP::EProxyAddress, + RHTTPSession::GetTable() ) ); // RConnection has been started, set proxy (if defined) and RConnection and // Socket Server session properties. // Proxy - result = aConnection.EnumerateConnections(connCount); - User::LeaveIfError(result); + result = aConnection.EnumerateConnections( connCount ); + User::LeaveIfError( result) ; // Get service and service type for this connection // _LIT(string, "%s\\%s"); - query.Format(string, IAP, IAP_SERVICE); - result = aConnection.GetIntSetting(query, serviceId); + query.Format( string, IAP, IAP_SERVICE ); + result = aConnection.GetIntSetting( query, serviceId ); - query.Format(string, IAP, IAP_SERVICE_TYPE); - result = aConnection.GetDesSetting(query, serviceType); - User::LeaveIfError(result); + query.Format( string, IAP, IAP_SERVICE_TYPE ); + result = aConnection.GetDesSetting( query, serviceType ); + User::LeaveIfError( result ); // RConnection and Socket Server // Now bind the HTTP session with the socket server connection connInfo.SetPropertyL ( - strPool.StringF(HTTP::EHttpSocketServ, RHTTPSession::GetTable()), - THTTPHdrVal (aSocketServ.Handle()) ); + strPool.StringF( HTTP::EHttpSocketServ, RHTTPSession::GetTable() ), + THTTPHdrVal (aSocketServ.Handle() ) ); - TInt connPtr1 = reinterpret_cast(&aConnection); + TInt connPtr1 = reinterpret_cast( &aConnection) ; connInfo.SetPropertyL ( - strPool.StringF(HTTP::EHttpSocketConnection, - RHTTPSession::GetTable() ), THTTPHdrVal (connPtr1) ); + strPool.StringF( HTTP::EHttpSocketConnection, + RHTTPSession::GetTable() ), THTTPHdrVal ( connPtr1 ) ); } @@ -188,7 +194,7 @@ if ( !iAttachDone ) { - err = iConnection.Attach( pckgInfo, RConnection::EAttachTypeMonitor); + err = iConnection.Attach( pckgInfo, RConnection::EAttachTypeMonitor ); DEBUG1("CIctsHttpHandler::SendHttpRequestL attach: %d", err); } @@ -199,11 +205,13 @@ // Remove redirect filter RStringPool stringPool = iHttpSession.StringPool(); - RStringF filterName = stringPool.StringF(HTTP::ERedirect, RHTTPSession::GetTable()); - iHttpSession.FilterCollection().RemoveFilter(filterName); - + RStringF filterName = + stringPool.StringF( HTTP::ERedirect, RHTTPSession::GetTable() ); + iHttpSession.FilterCollection().RemoveFilter( filterName ); + RStringPool strPool = iHttpSession.StringPool(); - RStringF method = strPool.StringF(HTTP::EHEAD,RHTTPSession::GetTable()); + RStringF method = + strPool.StringF( HTTP::EGET, RHTTPSession::GetTable() ); TBuf8 ip; @@ -217,7 +225,7 @@ // Parse string to URI TUriParser8 uri; uri.Parse(ip); - iHttpTransaction = iHttpSession.OpenTransactionL(uri, *this, method); + iHttpTransaction = iHttpSession.OpenTransactionL( uri, *this, method ); RHTTPHeaders hdr = iHttpTransaction.Request().GetHeaderCollection(); RStringF headerStrName = strPool.OpenFStringL( KHeaderName() ); @@ -279,35 +287,27 @@ // Called by framework to pass transaction events. // --------------------------------------------------------------------------- // -void CIctsHttpHandler::MHFRunL(RHTTPTransaction aTransaction, - const THTTPEvent& aEvent) +void CIctsHttpHandler::MHFRunL( RHTTPTransaction aTransaction, + const THTTPEvent& aEvent ) { - DEBUG("CIctsHttpHandler::MHFRunL"); - + DEBUG1("CIctsHttpHandler::MHFRunL aEvent.iStatus: %d", + aEvent.iStatus); + // See HTTP event statuses. Only ESucceeded and EFailed are needed. switch (aEvent.iStatus) { - case THTTPEvent::EGotResponseHeaders: { DEBUG("CIctsHttpHandler::THTTPEvent::EGotResponseHeaders"); - } - break; - - case THTTPEvent::EGotResponseBodyData: - { - DEBUG("CIctsHttpHandler::THTTPEvent::EGotResponseBodyData"); + if ( CheckStatusCodeL( aTransaction ) ) + { + // Redirection found. Transaction can be canceled. + aTransaction.Cancel(); + } } break; - - case THTTPEvent::EResponseComplete: - { - DEBUG("CIctsHttpHandler::THTTPEvent::EResponseComplete"); - } - break; - case THTTPEvent::ESucceeded: { - DEBUG("CIctsHttpHandler::THTTPEvent::ESucceeded"); + DEBUG("CIctsHttpHandler::MHFRunL Succeeded"); CTimer::Cancel(); iOwner.HttpEventL( EConnectionOk, iString ); iString = KNullDesC; @@ -316,79 +316,17 @@ case THTTPEvent::EFailed: { + DEBUG("CIctsHttpHandler::MHFRunL Failed"); CTimer::Cancel(); - DEBUG("CIctsHttpHandler::THTTPEvent::EFailed"); - - RHTTPResponse resp = aTransaction.Response(); - TInt status = resp.StatusCode(); - - // Check if redirect was cause of EFailed - if( status == KMovedPermanently || status == KFound || - status == KSeeOther || status == KTemporaryRedirect ) - { - - // Inform the hotspot server that authentication is needed - RHTTPHeaders hdr =aTransaction.Response().GetHeaderCollection(); - RStringPool strP = aTransaction.Session().StringPool(); - RStringF location = strP.StringF(HTTP::ELocation,RHTTPSession::GetTable()); - - //parse the headers and look for location header - THTTPHdrVal hVal; - if(hdr.GetField(location,0,hVal)== KErrNone) - { - DEBUG("CIctsHttpHandler::THTTPEvent::GetField"); - // Location header is present - RStringF fieldValStr = strP.StringF(hVal.StrF()); - const TDesC8& fieldValDesC = fieldValStr.DesC(); - iString.Copy(fieldValDesC); - iOwner.HttpEventL( EHttpAuthenticationNeeded, iString ); - } - else - { - // No location header. Can't use authentication -> redirect. - iOwner.HttpEventL( EConnectionNotOk, iString ); - } - } - else - { - // Failed for other reason than redirect - iOwner.HttpEventL( EConnectionNotOk, iString ); - } - - iString = KNullDesC; + iOwner.HttpEventL( EConnectionNotOk, iString ); + iString = KNullDesC; } break; - case THTTPEvent::ERedirectedPermanently: - { - // Nothing here - DEBUG("CIctsHttpHandler::THTTPEvent::ERedirectedPermanently"); - } - break; - - case THTTPEvent::ERedirectedTemporarily: - { - // Nothing here - DEBUG("CIctsHttpHandler::THTTPEvent::ERedirectedTemporarily"); - } - break; - default: { - DEBUG1( "CIctsHttpHandler::MHFRunL::default iStatus: %d", aEvent.iStatus ); - CTimer::Cancel(); - if ( aEvent.iStatus < 0 ) - { - _LIT(string, "Unknown error"); - iString = string; - iOwner.HttpEventL( EConnectionNotOk, iString ); - } - else - { - _LIT(string, "Default"); - iString = string; - iOwner.HttpEventL( EConnectionNotOk, iString ); - } + DEBUG1( "CIctsHttpHandler::MHFRunL default: %d", aEvent.iStatus ); + // Do nothing. Timer will take care of error situations. } break; } @@ -418,4 +356,57 @@ return ( 0 == aIPAddress.Find( KHttpPrefix ) ); } +// ---------------------------------------------------------------------------- +// CIctsHttpHandler::CheckStatusCodeL +// ---------------------------------------------------------------------------- +TBool CIctsHttpHandler::CheckStatusCodeL( RHTTPTransaction aTransaction ) + { + DEBUG1("CIctsHttpHandler::CheckStatusCodeL response statuscode: %d", + aTransaction.Response().StatusCode()); + + TBool ret ( EFalse ); + + switch ( aTransaction.Response().StatusCode() ) + { + case KMovedPermanently: + case KFound: + case KSeeOther: + case KTemporaryRedirect: + { + DEBUG("CIctsHttpHandler::CheckStatusCodeL Redirect"); + CTimer::Cancel(); + ret = ETrue; + + //parse the headers and look for location header + RHTTPHeaders hdr =aTransaction.Response().GetHeaderCollection(); + RStringPool strP = aTransaction.Session().StringPool(); + RStringF location = + strP.StringF( HTTP::ELocation,RHTTPSession::GetTable() ); + THTTPHdrVal hVal; + if( hdr.GetField( location, 0, hVal ) == KErrNone ) + { + DEBUG("CIctsHttpHandler::CheckStatusCodeL location header"); + // Location header is present + RStringF fieldValStr = strP.StringF(hVal.StrF()); + const TDesC8& fieldValDesC = fieldValStr.DesC(); + iString.Copy( fieldValDesC ); + iOwner.HttpEventL( EHttpAuthenticationNeeded, iString ); + } + else + { + DEBUG("CIctsHttpHandler::CheckStatusCodeL no location header"); + // No location header. Can't redirect. + iOwner.HttpEventL( EConnectionNotOk, iString ); + iString = KNullDesC; + } + } + break; + + default: + // Do nothing + break; + } + return ret; + } + // End of File diff -r 024ee8b21fe2 -r aaabc7526ded wlanutilities/wlansniffer/engine/server/src/wsfwlanbearerconnectionmonitor.cpp --- a/wlanutilities/wlansniffer/engine/server/src/wsfwlanbearerconnectionmonitor.cpp Tue May 25 13:53:32 2010 +0300 +++ b/wlanutilities/wlansniffer/engine/server/src/wsfwlanbearerconnectionmonitor.cpp Wed Jun 09 10:53:40 2010 +0300 @@ -580,6 +580,11 @@ } } LOG_WRITEF( "conn.secmode = %d", aWlanInfo->iSecurityMode ); + + aWlanInfo->SetUsesPreSharedKey( + EConnMonSecurityWpaPsk == securityAttribute ); + + LOG_WRITEF( "conn.usespresharedkey = %d", aWlanInfo->UsesPreSharedKey() ); // network mode TInt networkModeAttribute( 0 ); diff -r 024ee8b21fe2 -r aaabc7526ded wlanutilities/wlansniffer/engine/server/src/wsfwlanscanner.cpp --- a/wlanutilities/wlansniffer/engine/server/src/wsfwlanscanner.cpp Tue May 25 13:53:32 2010 +0300 +++ b/wlanutilities/wlansniffer/engine/server/src/wsfwlanscanner.cpp Wed Jun 09 10:53:40 2010 +0300 @@ -418,6 +418,7 @@ iScanArray->MatchL( connectedInfo->iSsid, connectedInfo->iSecurityMode, connectedInfo->iNetMode, + connectedInfo->UsesPreSharedKey(), iScanArray->Count(), matchArray ); } @@ -428,7 +429,9 @@ LOG_WRITE( "Easy WLAN connection" ); iScanArray->MatchL( connectedInfo->iSsid, connectedInfo->iSecurityMode, - connectedInfo->iNetMode, iScanArray->Count(), + connectedInfo->iNetMode, + connectedInfo->UsesPreSharedKey(), + iScanArray->Count(), matchArray ); } @@ -1045,8 +1048,12 @@ // found several iaps configured for same wlan) RPointerArray matchArray; CleanupClosePushL(matchArray); - iScanArray->MatchL( wlanInfo->iSsid, wlanInfo->iSecurityMode, - wlanInfo->iNetMode, nElem, matchArray ); + iScanArray->MatchL( wlanInfo->iSsid, + wlanInfo->iSecurityMode, + wlanInfo->iNetMode, + wlanInfo->UsesPreSharedKey(), + nElem, + matchArray ); TInt matchcount = matchArray.Count(); diff -r 024ee8b21fe2 -r aaabc7526ded wlanutilities/wlansniffer/mainapplication/inc/wsfconnecteddetailsdialog.h --- a/wlanutilities/wlansniffer/mainapplication/inc/wsfconnecteddetailsdialog.h Tue May 25 13:53:32 2010 +0300 +++ b/wlanutilities/wlansniffer/mainapplication/inc/wsfconnecteddetailsdialog.h Wed Jun 09 10:53:40 2010 +0300 @@ -91,7 +91,17 @@ * @param aModel List model of the dialog */ void SetListModel( CWsfConnectedDetailsModel* aModel ); - + + /** + * Super class method overriden to prevent dialog window to be + * shut down by pressing anywhere in the dialog (only pressing + * the OK button should close the dialog. + * @param aListBox - + * @param TListBoxEvent - + */ + void HandleListBoxEventL( CEikListBox* aListBox, + TListBoxEvent aEventType ); + private: // from CEikDialog /** diff -r 024ee8b21fe2 -r aaabc7526ded wlanutilities/wlansniffer/mainapplication/src/wsfconnecteddetailsdialog.cpp --- a/wlanutilities/wlansniffer/mainapplication/src/wsfconnecteddetailsdialog.cpp Tue May 25 13:53:32 2010 +0300 +++ b/wlanutilities/wlansniffer/mainapplication/src/wsfconnecteddetailsdialog.cpp Wed Jun 09 10:53:40 2010 +0300 @@ -170,5 +170,13 @@ return iController; } +// --------------------------------------------------------- +// CWsfConnectedDetailsDialog::HandleListBoxEventL +// --------------------------------------------------------- +// +void CWsfConnectedDetailsDialog::HandleListBoxEventL( CEikListBox* /*aListBox*/, + TListBoxEvent /*aEventType*/ ) + { + } + // End of File - diff -r 024ee8b21fe2 -r aaabc7526ded wlanutilities/wlansniffer/mainapplication/src/wsfmaincontroller.cpp --- a/wlanutilities/wlansniffer/mainapplication/src/wsfmaincontroller.cpp Tue May 25 13:53:32 2010 +0300 +++ b/wlanutilities/wlansniffer/mainapplication/src/wsfmaincontroller.cpp Wed Jun 09 10:53:40 2010 +0300 @@ -470,6 +470,7 @@ && info.iSecurityMode == CMManager::EWlanSecModeWpa ) { iAppUi->ShowGlobalErrorNoteL( KErrNotSupported ); + CleanupStack::PopAndDestroy(); return; } @@ -558,6 +559,7 @@ && info.iSecurityMode == CMManager::EWlanSecModeWpa ) { iAppUi->ShowGlobalErrorNoteL( KErrNotSupported ); + CleanupStack::PopAndDestroy(); return; } diff -r 024ee8b21fe2 -r aaabc7526ded wlanutilities/wlansniffer/wlaninfo/bwins/wsfwlaninfou.def --- a/wlanutilities/wlansniffer/wlaninfo/bwins/wsfwlaninfou.def Tue May 25 13:53:32 2010 +0300 +++ b/wlanutilities/wlansniffer/wlaninfo/bwins/wsfwlaninfou.def Wed Jun 09 10:53:40 2010 +0300 @@ -18,17 +18,17 @@ ?MatchWithIapIDL@CWsfWlanInfoArray@@QAEXIHAAV?$RPointerArray@VTWsfWlanInfo@@@@@Z @ 17 NONAME ; void CWsfWlanInfoArray::MatchWithIapIDL(unsigned int, int, class RPointerArray &) ?FindHiddenEntry@CWsfWlanInfoArray@@QAEPAVTWsfWlanInfo@@H@Z @ 18 NONAME ; class TWsfWlanInfo * CWsfWlanInfoArray::FindHiddenEntry(int) ?GetIapNameAsUtf8LC@TWsfWlanInfo@@QAEPAVHBufC8@@XZ @ 19 NONAME ; class HBufC8 * TWsfWlanInfo::GetIapNameAsUtf8LC(void) - ?MatchL@CWsfWlanInfoArray@@QAEXABVTDesC8@@W4TWlanSecMode@CMManager@@W4TWlanNetMode@4@HAAV?$RPointerArray@VTWsfWlanInfo@@@@@Z @ 20 NONAME ; void CWsfWlanInfoArray::MatchL(class TDesC8 const &, enum CMManager::TWlanSecMode, enum CMManager::TWlanNetMode, int, class RPointerArray &) - ?SortArrayL@CWsfWlanInfoArray@@QAEXAAVMWsfWlanInfoArrayFilterVisitor@@@Z @ 21 NONAME ; void CWsfWlanInfoArray::SortArrayL(class MWsfWlanInfoArrayFilterVisitor &) - ?GetArrayIndex@CWsfWlanInfoArray@@QBEHPAVTWsfWlanInfo@@@Z @ 22 NONAME ; int CWsfWlanInfoArray::GetArrayIndex(class TWsfWlanInfo *) const - ?SortArrayL@CWsfWlanInfoArray@@QAEXXZ @ 23 NONAME ; void CWsfWlanInfoArray::SortArrayL(void) - ?NewL@CWsfWlanInfoArray@@SAPAV1@XZ @ 24 NONAME ; class CWsfWlanInfoArray * CWsfWlanInfoArray::NewL(void) - ?GetUIPrioritySort@CWsfWlanInfoArray@@QAEHXZ @ 25 NONAME ; int CWsfWlanInfoArray::GetUIPrioritySort(void) - ?GetIapNameAsUnicodeLC@TWsfWlanInfo@@QAEPAVHBufC16@@XZ @ 26 NONAME ; class HBufC16 * TWsfWlanInfo::GetIapNameAsUnicodeLC(void) - ??0TWsfWlanInfo@@QAE@XZ @ 27 NONAME ; TWsfWlanInfo::TWsfWlanInfo(void) - ?SignalStrengthPercentage@TWsfWlanInfo@@QAEHXZ @ 28 NONAME ; int TWsfWlanInfo::SignalStrengthPercentage(void) - ?InternalizeL@TWsfWlanInfo@@QAEXAAVRReadStream@@@Z @ 29 NONAME ; void TWsfWlanInfo::InternalizeL(class RReadStream &) - ?SerializeContentLC@CWsfWlanInfoArray@@QAEPAVHBufC8@@XZ @ 30 NONAME ; class HBufC8 * CWsfWlanInfoArray::SerializeContentLC(void) - ?Match@CWsfWlanInfoArray@@QAEPAVTWsfWlanInfo@@ABVTDesC8@@H@Z @ 31 NONAME ; class TWsfWlanInfo * CWsfWlanInfoArray::Match(class TDesC8 const &, int) - ?Match@CWsfWlanInfoArray@@QAEPAVTWsfWlanInfo@@KH@Z @ 32 NONAME ; class TWsfWlanInfo * CWsfWlanInfoArray::Match(unsigned long, int) + ?SortArrayL@CWsfWlanInfoArray@@QAEXAAVMWsfWlanInfoArrayFilterVisitor@@@Z @ 20 NONAME ; void CWsfWlanInfoArray::SortArrayL(class MWsfWlanInfoArrayFilterVisitor &) + ?GetArrayIndex@CWsfWlanInfoArray@@QBEHPAVTWsfWlanInfo@@@Z @ 21 NONAME ; int CWsfWlanInfoArray::GetArrayIndex(class TWsfWlanInfo *) const + ?SortArrayL@CWsfWlanInfoArray@@QAEXXZ @ 22 NONAME ; void CWsfWlanInfoArray::SortArrayL(void) + ?NewL@CWsfWlanInfoArray@@SAPAV1@XZ @ 23 NONAME ; class CWsfWlanInfoArray * CWsfWlanInfoArray::NewL(void) + ?GetUIPrioritySort@CWsfWlanInfoArray@@QAEHXZ @ 24 NONAME ; int CWsfWlanInfoArray::GetUIPrioritySort(void) + ?GetIapNameAsUnicodeLC@TWsfWlanInfo@@QAEPAVHBufC16@@XZ @ 25 NONAME ; class HBufC16 * TWsfWlanInfo::GetIapNameAsUnicodeLC(void) + ??0TWsfWlanInfo@@QAE@XZ @ 26 NONAME ; TWsfWlanInfo::TWsfWlanInfo(void) + ?SignalStrengthPercentage@TWsfWlanInfo@@QAEHXZ @ 27 NONAME ; int TWsfWlanInfo::SignalStrengthPercentage(void) + ?SerializeContentLC@CWsfWlanInfoArray@@QAEPAVHBufC8@@XZ @ 28 NONAME ; class HBufC8 * CWsfWlanInfoArray::SerializeContentLC(void) + ?Match@CWsfWlanInfoArray@@QAEPAVTWsfWlanInfo@@KH@Z @ 29 NONAME ; class TWsfWlanInfo * CWsfWlanInfoArray::Match(unsigned long, int) + ?InternalizeL@TWsfWlanInfo@@QAEXAAVRReadStream@@@Z @ 30 NONAME ; void TWsfWlanInfo::InternalizeL(class RReadStream &) + ?MatchL@CWsfWlanInfoArray@@QAEXABVTDesC8@@W4TWlanSecMode@CMManager@@W4TWlanNetMode@4@HHAAV?$RPointerArray@VTWsfWlanInfo@@@@@Z @ 31 NONAME ; void CWsfWlanInfoArray::MatchL(class TDesC8 const &, enum CMManager::TWlanSecMode, enum CMManager::TWlanNetMode, int, int, class RPointerArray &) + ?Match@CWsfWlanInfoArray@@QAEPAVTWsfWlanInfo@@ABVTDesC8@@H@Z @ 32 NONAME ; class TWsfWlanInfo * CWsfWlanInfoArray::Match(class TDesC8 const &, int) diff -r 024ee8b21fe2 -r aaabc7526ded wlanutilities/wlansniffer/wlaninfo/eabi/wsfwlaninfou.def --- a/wlanutilities/wlansniffer/wlaninfo/eabi/wsfwlaninfou.def Tue May 25 13:53:32 2010 +0300 +++ b/wlanutilities/wlansniffer/wlaninfo/eabi/wsfwlaninfou.def Wed Jun 09 10:53:40 2010 +0300 @@ -23,14 +23,14 @@ _ZN17CWsfWlanInfoArray4NewLEv @ 22 NONAME _ZN17CWsfWlanInfoArray5CountEv @ 23 NONAME _ZN17CWsfWlanInfoArray5MatchERK6TDesC8i @ 24 NONAME - _ZN17CWsfWlanInfoArray5NewLCEv @ 25 NONAME - _ZN17CWsfWlanInfoArray5ResetEv @ 26 NONAME - _ZN17CWsfWlanInfoArray6DeleteEP12TWsfWlanInfo @ 27 NONAME - _ZN17CWsfWlanInfoArray6MatchLERK6TDesC8N9CMManager12TWlanSecModeENS3_12TWlanNetModeEiR13RPointerArrayI12TWsfWlanInfoE @ 28 NONAME - _ZN17CWsfWlanInfoArray7AppendLEP12TWsfWlanInfo @ 29 NONAME - _ZNK12TWsfWlanInfo12ExternalizeLER12RWriteStream @ 30 NONAME - _ZNK17CWsfWlanInfoArray13GetArrayIndexEP12TWsfWlanInfo @ 31 NONAME - _ZNK17CWsfWlanInfoArray2AtEi @ 32 NONAME - _ZNK17CWsfWlanInfoArrayixEj @ 33 NONAME - _ZN17CWsfWlanInfoArray5MatchEmi @ 34 NONAME + _ZN17CWsfWlanInfoArray5MatchEmi @ 25 NONAME + _ZN17CWsfWlanInfoArray5NewLCEv @ 26 NONAME + _ZN17CWsfWlanInfoArray5ResetEv @ 27 NONAME + _ZN17CWsfWlanInfoArray6DeleteEP12TWsfWlanInfo @ 28 NONAME + _ZN17CWsfWlanInfoArray6MatchLERK6TDesC8N9CMManager12TWlanSecModeENS3_12TWlanNetModeEiiR13RPointerArrayI12TWsfWlanInfoE @ 29 NONAME + _ZN17CWsfWlanInfoArray7AppendLEP12TWsfWlanInfo @ 30 NONAME + _ZNK12TWsfWlanInfo12ExternalizeLER12RWriteStream @ 31 NONAME + _ZNK17CWsfWlanInfoArray13GetArrayIndexEP12TWsfWlanInfo @ 32 NONAME + _ZNK17CWsfWlanInfoArray2AtEi @ 33 NONAME + _ZNK17CWsfWlanInfoArrayixEj @ 34 NONAME diff -r 024ee8b21fe2 -r aaabc7526ded wlanutilities/wlansniffer/wlaninfo/inc/wsfwlaninfoarray.h --- a/wlanutilities/wlansniffer/wlaninfo/inc/wsfwlaninfoarray.h Tue May 25 13:53:32 2010 +0300 +++ b/wlanutilities/wlansniffer/wlaninfo/inc/wsfwlaninfoarray.h Wed Jun 09 10:53:40 2010 +0300 @@ -148,36 +148,38 @@ * @return Pointer to the wlan info object (ownership not passed), or * NULL if ssid is not found */ - IMPORT_C void MatchWithIapIDL( const TUint aIapID, - const TInt aPriorThis, - RPointerArray& aMatchArray ); - - - /** - * Returns the info array element matching the SSID, security mode and net mode - * prior the given index - * @since S60 5.0 - * @param aSsid The SSID to match - * @param aSecMode The security mode to match - * @param aNetMode The network mode to match - * @param aPriorThis The index after which results are not reported - * @return Pointer to the wlan info object (ownership not passed), or - * NULL if ssid is not found - */ - IMPORT_C void MatchL( const TDesC8& aSsid, - CMManager::TWlanSecMode aSecMode, - CMManager::TWlanNetMode aNetMode, - const TInt aPriorThis, - RPointerArray& aMatchArray ); - - /** - * Serialize the array content to a buffer and pushes it on the - * cleanup stack + IMPORT_C void MatchWithIapIDL( const TUint aIapID, + const TInt aPriorThis, + RPointerArray& aMatchArray ); + + + /** + * Returns the info array element matching the SSID, security mode and net mode + * prior the given index + * @since S60 5.0 + * @param aSsid The SSID to match + * @param aSecMode The security mode to match + * @param aNetMode The network mode to match + * @param aUsesPreSharedKey pre shared key usage to match + * @param aPriorThis The index after which results are not reported + * @return Pointer to the wlan info object (ownership not passed), or + * NULL if ssid is not found + */ + IMPORT_C void MatchL( const TDesC8& aSsid, + CMManager::TWlanSecMode aSecMode, + CMManager::TWlanNetMode aNetMode, + TBool aUsesPreSharedKey, + const TInt aPriorThis, + RPointerArray& aMatchArray ); + + /** + * Serialize the array content to a buffer and pushes it on the + * cleanup stack * @since S60 5.0 - * @return The buffer created - */ - IMPORT_C HBufC8* SerializeContentLC(); - + * @return The buffer created + */ + IMPORT_C HBufC8* SerializeContentLC(); + /** * Read wlan info objects from buffer and append them to the array * @since S60 5.0 diff -r 024ee8b21fe2 -r aaabc7526ded wlanutilities/wlansniffer/wlaninfo/src/wsfwlaninfoarray.cpp --- a/wlanutilities/wlansniffer/wlaninfo/src/wsfwlaninfoarray.cpp Tue May 25 13:53:32 2010 +0300 +++ b/wlanutilities/wlansniffer/wlaninfo/src/wsfwlaninfoarray.cpp Wed Jun 09 10:53:40 2010 +0300 @@ -285,6 +285,7 @@ EXPORT_C void CWsfWlanInfoArray::MatchL( const TDesC8& aSsid, CMManager::TWlanSecMode aSecMode, CMManager::TWlanNetMode aNetMode, + TBool aUsesPreSharedKey, const TInt aPriorThis, RPointerArray& aMatchArray ) { @@ -298,10 +299,33 @@ for( TInt i = 0; i < count ; i++ ) { temp = ( *iInfoArray )[i]; - if( !temp->iSsid.Compare( aSsid ) && temp->iSecurityMode == aSecMode && temp->iNetMode == aNetMode) + if( !temp->iSsid.Compare( aSsid ) && temp->iSecurityMode == aSecMode + && temp->iNetMode == aNetMode ) { aMatchArray.AppendL(temp); } + else if ( temp->iIapId && !temp->iSsid.Compare( aSsid ) + && temp->SecurityMode() == CMManager::EWlanSecMode802_1x + && temp->iNetMode == aNetMode ) + { + if ( aSecMode == CMManager::EWlanSecModeOpen ) + { + aMatchArray.AppendL(temp); + } + else if ( aSecMode == CMManager::EWlanSecModeWep ) + { + aMatchArray.AppendL(temp); + } + else if ( aSecMode == CMManager::EWlanSecModeWpa + && !aUsesPreSharedKey ) + { + aMatchArray.AppendL(temp); + } + else if ( aSecMode == CMManager::EWlanSecMode802_1x ) + { + aMatchArray.AppendL(temp); + } + } } } // ---------------------------------------------------------------------------