# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1270066294 -10800 # Node ID a15e6baef5102298035880616ad26b59ba3fe6cd # Parent e4ed1060deb1e981f741a3ad50e34f8ed49f2859 Revision: 201011 Kit: 201013 diff -r e4ed1060deb1 -r a15e6baef510 package_definition.xml --- a/package_definition.xml Mon Mar 15 12:44:44 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,167 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r e4ed1060deb1 -r a15e6baef510 vpnc_plat/vpnapi/inc/vpnnotifierdefs.h --- a/vpnc_plat/vpnapi/inc/vpnnotifierdefs.h Mon Mar 15 12:44:44 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,184 +0,0 @@ -/* -* Copyright (c) 2003-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: VPN notifier definitions -* -*/ - - -#ifndef __VPNNOTIFIERDEFS_H__ -#define __VPNNOTIFIERDEFS_H__ - -/** - @file - @released - @publishedPartner - - VPN Notifier definitions -*/ -class TNoteDialog - { -public: - enum TDialogId - { - EInfo = -10, - EWarning, - EError - }; - }; - -class TVpnDialogInfo - { -public: - TVpnDialogInfo() - { - iDialogId = 0; - iNoteDialogId = 0; - } - - TVpnDialogInfo(TInt aDialogId, TInt aNoteDialogId) - { - iDialogId = aDialogId; - iNoteDialogId = aNoteDialogId; - } - - TInt DialogId() {return iDialogId;} - TInt NoteDialogId() {return iNoteDialogId;} - -private: - TInt iDialogId; - TInt iNoteDialogId; - }; - -class TVpnDialogOutput - { -public: - TVpnDialogOutput() - { - Clear(); - } - void Clear() - { - iOutBuf.SetLength(0); - iOutBuf2.SetLength(0); - iOutInt = 0; - iOutInt2 = 0; - } - -public: - TBuf<256> iOutBuf; - TBuf<64> iOutBuf2; - TInt iOutInt; - TInt iOutInt2; - }; - -// typedefs for backward compatibility -// typedef new_type old_type -typedef TVpnDialogInfo TIPSecDialogInfo; -typedef TVpnDialogOutput TIPSecDialogOutput; - - -// -// KMD notifier definitions -// -const TUid KUidKmdDialogNotifier = {0x101F513F}; - -_LIT(KKmdNotifierResource, "\\resource\\KMDNOTIFIER.RSC"); - -class TKmdDialog - { -public: - enum TDialogId - { - EUserPwd = 1, // MUST be greater than the last value in enum TNoteDialog::TDialogId - ESecurIdPin, - ESecurIdNextPin, - EChallengeResponse, - EUsername - }; - //added here for backward compatibility - enum TDialogId_OLD_STYLE - { - //EUserPwd = 1, // MUST be greater than the last value in enum TNoteDialog::TDialogId - ESecurIDPIN = 2, - ESecurIDNextPIN - }; - }; - -class TKmdNoteDialog - { -public: - enum TTextId - { - ELamTypeNotSupported = 1, - EAuthenticationFailed, - ECryptoLibraryTooWeak - }; - //added here for backward compatibility - enum TTextId_OLD_STYLE - { - ELAMTypeNotSupported = 1//, - //EAuthenticationFailed, - //ECryptoLibraryTooWeak - }; - }; - -// typedefs for backward compatibility -// typedef existing_type old_type -typedef TKmdDialog TKMDDialog; - -typedef TKmdNoteDialog TKMDNoteDialog; - -// -// PKI notifier definitions -// -_LIT(KPkiNotifierResource,"\\resource\\PKINOTIFIER.RSC"); - -const TUid KUidPkiDialogNotifier = {0x101FAE08}; - -class TPkiDialog - { -public: - enum TDialogId - { - EEnterPwd = 1, // MUST be greater than the last value in enum TNoteDialog::TDialogId (vpnnotifierdefs.h) - EChangeActivePwd, - EInstallVpnPwd, - ECurrentVpnPwd, - EChangePwd, - EDefinePwd, - EEnterImportPwd - }; - }; - -class TPkiNoteDialog - { -public: - enum TTextId - { - EWrongSecurityPwdNote = 1, - EWrongActivatePwdNote, - EActivatePwdErrorNote, - EPwdConfirmationNote, - ECryptoLibraryTooWeak, - EPwdTooShort, - EPwdEmpty - }; - }; - -// typedefs for backward compatibility -// typedef new_type old_type -typedef TPkiDialog TIPSecDialog; -typedef TPkiNoteDialog TIPSecNoteDialog; // this was only used in pkinotifier (ipsecnotifier) - -#endif // __VPNNOTIFIERDEFS_H__ diff -r e4ed1060deb1 -r a15e6baef510 vpnclient_sis/stub_sis/group/stub_nokia_vpn_client_armv5.pkg --- a/vpnclient_sis/stub_sis/group/stub_nokia_vpn_client_armv5.pkg Mon Mar 15 12:44:44 2010 +0200 +++ b/vpnclient_sis/stub_sis/group/stub_nokia_vpn_client_armv5.pkg Wed Mar 31 23:11:34 2010 +0300 @@ -1,5 +1,5 @@ ; -; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +; Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). ; All rights reserved. ; This component and the accompanying materials are made available ; under the terms of "Eclipse Public License v1.0" @@ -11,25 +11,8 @@ ; ; Contributors: ; -; Description: -; - -; ============================================================================ -; Name : stub_nokia_vpn_client_armv5.pkg -; Part of : VPN / VPN -; Description : Nokia VPN Client G1 S60 PACKAGE for Stub-SIS -; Version : %version: % +; Description: vpnclient package file for stub SIS ; -; Copyright © 2006 - 2008 Nokia. All rights reserved. -; This material, including documentation and any related computer -; programs, is protected by copyright controlled by Nokia. All -; rights are reserved. Copying, including reproducing, storing, -; adapting or translating, any or all of this material requires the -; prior written consent of Nokia. This material also contains -; confidential information which may not be disclosed to others -; without the prior written consent of Nokia. -; ============================================================================ -; Template version: 4.1 ; LANGUAGES ; - None (English only by default) diff -r e4ed1060deb1 -r a15e6baef510 vpnengine/eventviewer/data/vpnlogmessages1.lms --- a/vpnengine/eventviewer/data/vpnlogmessages1.lms Mon Mar 15 12:44:44 2010 +0200 +++ b/vpnengine/eventviewer/data/vpnlogmessages1.lms Wed Mar 31 23:11:34 2010 +0300 @@ -1,21 +1,22 @@ /* -* ============================================================================== -* Name : vpnlogmessages1.lms -* Part of : eventviewer -* Description : This is a localisation file for IPSec VPN software log messages. -* Version : %version: 3 % +* Copyright (c) 2003-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". * -* Copyright © 2003-2008 Nokia. All rights reserved. -* This material, including documentation and any related computer -* programs, is protected by copyright controlled by Nokia. All -* rights are reserved. Copying, including reproducing, storing, -* adapting or translating, any or all of this material requires the -* prior written consent of Nokia. This material also contains -* confidential information which may not be disclosed to others -* without the prior written consent of Nokia. -* ============================================================================ -* Template version: 4.1 +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: * +* Description: VPN log messages +* +*/ + + +/* * Syntax of a logical name entry in this file is the following: * * // d:context description (line 1) @@ -44,6 +45,7 @@ * ============================================================================== */ + // LOCALISATION STRINGS // **VPN LOG MESSAGES diff -r e4ed1060deb1 -r a15e6baef510 vpnengine/ikesocket/inc/receiver.h --- a/vpnengine/ikesocket/inc/receiver.h Mon Mar 15 12:44:44 2010 +0200 +++ b/vpnengine/ikesocket/inc/receiver.h Wed Mar 31 23:11:34 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -68,7 +68,7 @@ * * @lib ikesocket.lib */ -NONSHARABLE_CLASS( CReceiver ) : private CActive +NONSHARABLE_CLASS( CReceiver ) : private CTimer { public: /** @@ -113,9 +113,10 @@ enum TReceiverState { - EIdle, // Idle - EWaitingData, // Waiting data to become available for reading - EReceiving // Receiving data + EIdle, // Idle + EWaitingData, // Waiting data to become available for reading + EReceiving, // Receiving data + EWaitingAfterSocketError // Waiting after socket error }; CReceiver( RSocket& aSocket, @@ -141,8 +142,11 @@ /** * Handles error in receiving. + * @param aStatus Error status + * @param aSocket Informs if delay needed */ - void HandleError( const TInt aStatus ); + void HandleError( const TInt aStatus, + const TBool aDelayNeeded = EFalse ); /** * Notifies client that data has been received. @@ -180,7 +184,13 @@ * Own. */ TReceiverState iState; - + + /** + * Maximum error count. + * Own. + */ + TInt iErrorCount; + /** * Message data. * Own. diff -r e4ed1060deb1 -r a15e6baef510 vpnengine/ikesocket/src/connobserver.cpp --- a/vpnengine/ikesocket/src/connobserver.cpp Mon Mar 15 12:44:44 2010 +0200 +++ b/vpnengine/ikesocket/src/connobserver.cpp Wed Mar 31 23:11:34 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -83,7 +83,7 @@ CConnObserver::CConnObserver( RConnection& aConnection, MConnObserverCallback& aCallback, MIkeDebug& aDebug ) - :CActive(EPriorityStandard), + :CActive( EPriorityStandard ), iConnection( aConnection ), iCallback( aCallback ), iDebug( aDebug ) @@ -107,8 +107,15 @@ // void CConnObserver::RunL() { - DEBUG_LOG1( _L("CConnObserver::RunL(), iStatus=%d"), iStatus.Int() ); - iCallback.LinkDisconnected( iStatus.Int() ); + DEBUG_LOG2( _L("CConnObserver::RunL(), iStatus=%d, error=%d"), + iStatus.Int(), iProgressBuf().iError ); + TInt status = iStatus.Int(); + if ( status == KErrNone ) + { + status = iProgressBuf().iError; + } + + iCallback.LinkDisconnected( status ); } // --------------------------------------------------------------------------- diff -r e4ed1060deb1 -r a15e6baef510 vpnengine/ikesocket/src/receiver.cpp --- a/vpnengine/ikesocket/src/receiver.cpp Mon Mar 15 12:44:44 2010 +0200 +++ b/vpnengine/ikesocket/src/receiver.cpp Wed Mar 31 23:11:34 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -65,7 +65,7 @@ CReceiver::CReceiver( RSocket& aSocket, MReceiverCallback& aCallback, MIkeDebug& aDebug ) - : CActive( EPriorityStandard ), + : CTimer( EPriorityStandard ), iState( EIdle ), iMsgPtr( 0, 0, 0 ), iSocket( aSocket ), @@ -82,6 +82,7 @@ void CReceiver::ConstructL() { DEBUG_LOG( _L("CReceiver::ConstructL") ); + CTimer::ConstructL(); } // --------------------------------------------------------------------------- @@ -244,25 +245,38 @@ // Handles error in receiving. // --------------------------------------------------------------------------- // -void CReceiver::HandleError( const TInt aStatus ) +void CReceiver::HandleError( const TInt aStatus, + const TBool aDelayNeeded ) { - DEBUG_LOG1( _L("CReceiver::HandleError, aStatus=%d"), aStatus ); + DEBUG_LOG3( _L("CReceiver::HandleError, aStatus=%d, error count=%d, delay needed=%d"), + aStatus, iErrorCount, aDelayNeeded ); delete iMsg; iMsg = NULL; iMsgPtr.Set( 0, 0, 0 ); - iState = EIdle; + + const TInt KMaxReceiverErrorCount( 20 ); if ( aStatus == KErrDied || aStatus == KErrServerTerminated || - aStatus == KErrNoMemory ) + aStatus == KErrNoMemory || + iErrorCount >= KMaxReceiverErrorCount ) { - // Fatal error. Notify client. + // Fatal error or maximum error count reached. Notify client. + iState = EIdle; iCallback.ReceiveError( aStatus ); } + else if ( aDelayNeeded ) + { + // Restart receiving after delay. + iState = EWaitingAfterSocketError; + const TInt KDelayIntervalSocketError( 1000000 ); // 1s + After( iErrorCount*KDelayIntervalSocketError ); + } else { - // Error is not fatal. Restart receiving + // Receiving can be continued without delay. + iState = EIdle; Receive(); } } @@ -308,13 +322,15 @@ void CReceiver::RunL() { IKESOCKET_ASSERT( iState == EWaitingData || - iState == EReceiving ); + iState == EReceiving || + iState == EWaitingAfterSocketError ); DEBUG_LOG2( _L("CReceiver::RunL, iState=%d, iStatus=%d"), iState, iStatus.Int() ); if ( iStatus.Int() ) { - HandleError( iStatus.Int() ); + HandleError( iStatus.Int(), ETrue ); + iErrorCount++; return; } @@ -327,9 +343,16 @@ } case EReceiving: { + iErrorCount = 0; HandleDataReceivedL(); break; } + case EWaitingAfterSocketError: + { + iState = EIdle; + Receive(); + break; + } default: break; } @@ -343,10 +366,13 @@ void CReceiver::DoCancel() { IKESOCKET_ASSERT( iState == EWaitingData || - iState == EReceiving ); + iState == EReceiving || + iState == EWaitingAfterSocketError ); DEBUG_LOG1( _L("CReceiver::DoCancel, iState=%d"), iState ); + iErrorCount = 0; + switch ( iState ) { case EWaitingData: @@ -359,6 +385,11 @@ iSocket.CancelRecv(); break; } + case EWaitingAfterSocketError: + { + CTimer::DoCancel(); + break; + } default: break; } diff -r e4ed1060deb1 -r a15e6baef510 vpnengine/kmdserver/src/connectionstarter.cpp --- a/vpnengine/kmdserver/src/connectionstarter.cpp Mon Mar 15 12:44:44 2010 +0200 +++ b/vpnengine/kmdserver/src/connectionstarter.cpp Wed Mar 31 23:11:34 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -51,7 +51,7 @@ // CConnectionStarter::CConnectionStarter( CVpnConnection& aConnection, MConnectionStarterCallback& aCallback ) - : CActive( EPriorityStandard ), + : CActive( EPriorityHigh ), // Higher priority than in CDisconnectionObserver iConnection( aConnection ), iCallback( aCallback ) {