Revision: 201033 RCL_3 PDK_3.0.3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 14 Sep 2010 22:06:05 +0300
branchRCL_3
changeset 62 bb1f80fb7db2
parent 58 83ca720e2b9a
child 65 14754bf06654
Revision: 201033 Kit: 201035
bearermanagement/S60MCPR/inc/s60mcpr.h
bearermanagement/S60MCPR/inc/s60mcpractivities.h
bearermanagement/S60MCPR/inc/s60mcprstates.h
bearermanagement/S60MCPR/src/s60mcpr.cpp
bearermanagement/S60MCPR/src/s60mcpractivities.cpp
bearermanagement/S60MCPR/src/s60mcprstates.cpp
bearermanagement/mpm/group/mpmserver.mmp
bearermanagement/mpm/inc/mpmcommsdataccess.h
bearermanagement/mpm/inc/mpmconnmonevents.h
bearermanagement/mpm/inc/mpmconnselectiondlgtimer.h
bearermanagement/mpm/inc/mpmofflinequerytimer.h
bearermanagement/mpm/inc/mpmserver.h
bearermanagement/mpm/src/mpmcommsdataccess.cpp
bearermanagement/mpm/src/mpmconnmonevents.cpp
bearermanagement/mpm/src/mpmconnmonreqs.cpp
bearermanagement/mpm/src/mpmconnselectiondlgtimer.cpp
bearermanagement/mpm/src/mpmiapselection.cpp
bearermanagement/mpm/src/mpmofflinequerytimer.cpp
bearermanagement/mpm/src/mpmserver.cpp
bearermanagement/mpm/src/mpmwlanquerydialog.cpp
cmmanager/cmmgr/Plugins/Group/bld.inf
cmmanager/cmmgr/Plugins/cmplugintundriver/data/20027F3E.rss
cmmanager/cmmgr/Plugins/cmplugintundriver/group/bld.inf
cmmanager/cmmgr/Plugins/cmplugintundriver/group/cmplugintundriver.mmp
cmmanager/cmmgr/Plugins/cmplugintundriver/group/cmplugintundriver_icons.mk
cmmanager/cmmgr/Plugins/cmplugintundriver/inc/cmplugintundriver.h
cmmanager/cmmgr/Plugins/cmplugintundriver/inc/cmtundrivercommonconstants.h
cmmanager/cmmgr/Plugins/cmplugintundriver/src/cmpluginproxytundriver.cpp
cmmanager/cmmgr/Plugins/cmplugintundriver/src/cmplugintundriver.cpp
cmmanager/cmmgr/Rom/cmplugintundriver.iby
cmmanager/cmmgr/Rom/cmplugintundriverresources.iby
cmmanager/cmmgr/group/bld.inf
connectionmonitoring/connmon/connectionmonitor/src/connmoncommsdatcache.cpp
data/cccccc00_emulator.cre
inc/meshpreface1.cfg
ipcm_pub/connection_settings_api/group/bld.inf
ipcm_pub/connection_settings_api/inc/cmplugintundriverdef.h
--- a/bearermanagement/S60MCPR/inc/s60mcpr.h	Wed Sep 01 12:23:51 2010 +0100
+++ b/bearermanagement/S60MCPR/inc/s60mcpr.h	Tue Sep 14 22:06:05 2010 +0300
@@ -63,6 +63,7 @@
             EMPMStartIAPNotificationMsg,
             EMPMErrorNotificationMsg,
             EMPMStartupErrorIgnoredMsg,
+            EMPMStopIAPNotificationMsg,
             };
   public: 
     typedef Messages::TMessageSigVoid<EMPMReselectBestIAPCompletedMsg, TCFS60MCPRMessage::ERealmId>     TMPMReselectBestIAPCompletedMsg;
@@ -72,6 +73,7 @@
     typedef Messages::TMessageSigNumber<EMPMStartIAPNotificationMsg, TCFS60MCPRMessage::ERealmId>       TMPMStartIAPNotificationMsg;
     typedef Messages::TMessageSigNumber<EMPMErrorNotificationMsg, TCFS60MCPRMessage::ERealmId>          TMPMErrorNotificationMsg;
     typedef Messages::TMessageSigVoid<EMPMStartupErrorIgnoredMsg, TCFS60MCPRMessage::ERealmId>          TMPMStartupErrorIgnoredMsg;
+    typedef Messages::TMessageSigNumber<EMPMStopIAPNotificationMsg, TCFS60MCPRMessage::ERealmId>        TMPMStopIAPNotificationMsg;
     };
 
 /**
--- a/bearermanagement/S60MCPR/inc/s60mcpractivities.h	Wed Sep 01 12:23:51 2010 +0100
+++ b/bearermanagement/S60MCPR/inc/s60mcpractivities.h	Tue Sep 14 22:06:05 2010 +0300
@@ -32,7 +32,8 @@
 
 enum TS60MCprActivities
     {
-    ECFActivityS60McprServiceIdMessage2Handler = ESock::ECFActivityCustom + 10
+    ECFActivityS60McprServiceIdMessage2Handler = ESock::ECFActivityCustom + 10,
+    ECFActivityS60McprStopIAP
     };
 
 /**
--- a/bearermanagement/S60MCPR/inc/s60mcprstates.h	Wed Sep 01 12:23:51 2010 +0100
+++ b/bearermanagement/S60MCPR/inc/s60mcprstates.h	Tue Sep 14 22:06:05 2010 +0300
@@ -172,6 +172,39 @@
     virtual void DoL();
     DECLARE_SMELEMENT_FOOTER( TRetrieveServiceId )
 
+    /**
+     * STATE: Waits for StopIAPNotification message. 
+     * @return ETrue if message is accepted. 
+     */
+    DECLARE_SMELEMENT_HEADER( TAwaitingStopIAPNotification, 
+                              MeshMachine::TState<TContext>, 
+                              NetStateMachine::MState, 
+                              TContext )
+    virtual TBool Accept();
+    DECLARE_SMELEMENT_FOOTER( TAwaitingStopIAPNotification )
+
+    /**
+     * TRANSITION/ACTION: Sends Stop to Service Provider
+     */
+    DECLARE_SMELEMENT_HEADER( TSendStop, 
+                              MeshMachine::TStateTransition<TContext>, 
+                              NetStateMachine::MStateTransition, 
+                              TContext )
+    virtual void DoL();
+    DECLARE_SMELEMENT_FOOTER( TSendStop )
+    
+    
+    /**
+     * STATE: Waits for Stopped or Error
+     * @return ETrue if message is accepted. 
+     */
+    DECLARE_SMELEMENT_HEADER( TAwaitingStoppedOrError, 
+                              MeshMachine::TState<TContext>, 
+                              NetStateMachine::MState, 
+                              TContext )
+    virtual TBool Accept();
+    DECLARE_SMELEMENT_FOOTER( TAwaitingStoppedOrError )
+        
     class CS60ErrorRecoveryActivity : public MeshMachine::CNodeRetryActivity
         {
         public:
--- a/bearermanagement/S60MCPR/src/s60mcpr.cpp	Wed Sep 01 12:23:51 2010 +0100
+++ b/bearermanagement/S60MCPR/src/s60mcpr.cpp	Tue Sep 14 22:06:05 2010 +0300
@@ -381,23 +381,14 @@
             TMpmNotificationStopIAP& notification = 
                 static_cast<TMpmNotificationStopIAP&>( const_cast<TMpmNotification&>( aNotification ) );
 
-            // Allow TStop message only when ServiceProvider exists and the IAP matches or is unspecified. 
-            // 
-            if ( ServiceProvider() && 
-                    (((RMetaServiceProviderInterface*)ServiceProvider())->ProviderInfo().APId() == notification.iInfo.iIap ||
-                    notification.iInfo.iIap == 0 )) 
-                {
-                S60MCPRLOGSTRING2("S60MCPR<%x>::PolicyNotification() EMPMStopIAPNotification IAP %d",(TInt*)this,notification.iInfo.iIap);
-                PostToClients<TDefaultClientMatchPolicy>( TNodeCtxId( 0, Id() ),
-                                                          TCFServiceProvider::TStop( KErrDisconnected ).CRef(),
-                                                          TClientType( TCFClientType::EServProvider) );
-                }
-#ifdef _DEBUG
-            else
-                {
-                S60MCPRLOGSTRING2("S60MCPR<%x>::PolicyNotification() EMPMStopIAPNotification NO MATCH! IAP %d",(TInt*)this,notification.iInfo.iIap);
-                }
-#endif
+            S60MCPRLOGSTRING2("S60MCPR<%x>::PolicyNotification() EMPMStopIAPNotification IAP %d",(TInt*)this, notification.iInfo.iIap);
+           
+            // Send stop notification into meshmachine.
+            //
+            RNodeInterface ni;
+            ni.OpenPostMessageClose( NodeId(), 
+                                     NodeId(), 
+                                     TCFS60MCPRMessage::TMPMStopIAPNotificationMsg( notification.iInfo.iIap ).CRef() );
             break;
             }
         default:
--- a/bearermanagement/S60MCPR/src/s60mcpractivities.cpp	Wed Sep 01 12:23:51 2010 +0100
+++ b/bearermanagement/S60MCPR/src/s60mcpractivities.cpp	Tue Sep 14 22:06:05 2010 +0300
@@ -406,6 +406,31 @@
     } // S60MCprServiceIdRMessage2HandlerActivity
 
 // -----------------------------------------------------------------------------
+// S60MCprStopIAPActivity
+// -----------------------------------------------------------------------------
+//
+
+namespace S60MCprStopIAPActivity
+    {
+    DECLARE_DEFINE_NODEACTIVITY( ECFActivityS60McprStopIAP, 
+                                 MCprStopIAPActivity, 
+                                 TCFS60MCPRMessage::TMPMStopIAPNotificationMsg)
+
+    FIRST_NODEACTIVITY_ENTRY( S60MCprStates::TAwaitingStopIAPNotification, 
+                              MeshMachine::TNoTag )
+                              
+    NODEACTIVITY_ENTRY( KNoTag,
+                        S60MCprStates::TSendStop,
+                        S60MCprStates::TAwaitingStoppedOrError,
+                        MeshMachine::TNoTag )
+
+    LAST_NODEACTIVITY_ENTRY( KNoTag, 
+                             MeshMachine::TDoNothing )
+
+    NODEACTIVITY_END()
+    } // S60MCprStopIAPActivity
+
+// -----------------------------------------------------------------------------
 // S60MCprActivities - activitymap
 // -----------------------------------------------------------------------------
 //
@@ -419,6 +444,7 @@
     ACTIVITY_MAP_ENTRY(S60MCprMobilityActivity, MCprMobility) // in s60mcprmobilityactivity.cpp
     ACTIVITY_MAP_ENTRY(S60MCprConnectionGoneDownRecoveryActivity, MCprConnectionGoneDownRecovery)
     ACTIVITY_MAP_ENTRY(S60MCprServiceIdRMessage2HandlerActivity, S60MCprServiceIdLegacyRMessage2Handler)
+    ACTIVITY_MAP_ENTRY(S60MCprStopIAPActivity, MCprStopIAPActivity)
     ACTIVITY_MAP_END_BASE(MobilityMCprActivities, mobilityMCprActivities)
     }
 
--- a/bearermanagement/S60MCPR/src/s60mcprstates.cpp	Wed Sep 01 12:23:51 2010 +0100
+++ b/bearermanagement/S60MCPR/src/s60mcprstates.cpp	Tue Sep 14 22:06:05 2010 +0300
@@ -21,6 +21,7 @@
 */
 
 #include <cdblen.h>
+#include <comms-infras/mobilitymcpractivities.h>
 
 #include "s60mcprstates.h"
 
@@ -390,6 +391,99 @@
         }
     }
 
+
+// -----------------------------------------------------------------------------
+// TAwaitingStopIAPNotification::Accept
+// -----------------------------------------------------------------------------
+//
+DEFINE_SMELEMENT( TAwaitingStopIAPNotification, NetStateMachine::MState, TContext )
+TBool TAwaitingStopIAPNotification::Accept()
+    {  
+    TUint32 iapId( 0 );
+    TCFS60MCPRMessage::TMPMStopIAPNotificationMsg* msg =
+            message_cast<TCFS60MCPRMessage::TMPMStopIAPNotificationMsg>(&iContext.iMessage);
+    if ( msg )
+        {
+        iapId = msg->iValue;
+        // Only accept the notification if it matches current service provider, or if the IAP is undefined
+        if ( iContext.Node().ServiceProvider() &&
+             (((RMetaServiceProviderInterface*)iContext.Node().ServiceProvider())->ProviderInfo().APId() == iapId ||
+             iapId == 0 ) )
+            {
+            return ETrue;
+            }
+#ifdef _DEBUG
+        else
+            {
+            S60MCPRLOGSTRING2("S60MCPR<%x>::TAwaitingStopIAPNotification() NO MATCH! IAP %d",(TInt*)this,iapId);
+            }
+#endif        
+        }    
+    return EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// TProcessError::DoL
+// -----------------------------------------------------------------------------
+//
+DEFINE_SMELEMENT( TSendStop, NetStateMachine::MStateTransition, TContext )
+void TSendStop::DoL() // codescanner::leave
+    {
+    __ASSERT_DEBUG(iContext.iNodeActivity, User::Panic(KS60MCprPanic, KPanicNoActivity));
+    __ASSERT_DEBUG(iContext.Node().ServiceProvider(), User::Panic(KS60MCprPanic, KPanicNoServiceProvider));    
+    
+    // Send TStop to current Service Provider.
+    iContext.iNodeActivity->PostRequestTo( 
+            iContext.Node().ServiceProvider()->RecipientId(), 
+            TCFServiceProvider::TStop( KErrDisconnected ).CRef() );
+    }
+
+// -----------------------------------------------------------------------------
+// TAwaitingStoppedOrError::Accept
+// -----------------------------------------------------------------------------
+//
+DEFINE_SMELEMENT( TAwaitingStoppedOrError, NetStateMachine::MState, TContext )
+TBool TAwaitingStoppedOrError::Accept()
+    {
+    __ASSERT_DEBUG(iContext.iNodeActivity, User::Panic(KS60MCprPanic, KPanicNoActivity));
+    
+    if ( iContext.iMessage.IsMessage<TCFServiceProvider::TStopped>() )
+        {
+        return ETrue;
+        }
+    
+    // Error is returned if S60MCPR leaves IPProtoMCPr before Stopped is received
+    if( iContext.iMessage.IsMessage<TEBase::TError>() )
+        {
+        // Ignore the error code. It's better than crashing.
+        // Propagating might lead to situation where self-posted message ends up to a dead node.
+        return ETrue;
+        }    
+    
+    // Rare scenario: if the stopping service provider is sending a TStateChange message, 
+    // and a mobility activity is ongoing, the message must be ignored in order to keep
+    // harmful connection stages such as KLinkLayerClosed from reaching the client    
+    TUint32 mobilityActivities = iContext.Node().CountActivities( ECFActivityMCprMobility );
+    TBool isStateChange = iContext.iMessage.IsMessage<TCFMessage::TStateChange>();
+    TBool isServProvider = 
+            iContext.iPeer &&
+            iContext.iPeer->Type() == TCFClientType::EServProvider &&
+            iContext.iPeer->Flags() & TCFClientType::EActive;
+    
+    S60MCPRLOGSTRING4("S60MCPR<%x>::TAwaitingStoppedOrError() M %d, SC %d, SP %d",(TInt*)this,
+            mobilityActivities, isStateChange, isServProvider );
+        
+    if ( isStateChange && isServProvider && mobilityActivities > 0 )
+        {
+        // Discard the message 
+        iContext.iMessage.ClearMessageId();
+        }
+
+    return EFalse;
+    }
+
+
+
 // -----------------------------------------------------------------------------
 // TRetrieveServiceId::DoL
 // -----------------------------------------------------------------------------
--- a/bearermanagement/mpm/group/mpmserver.mmp	Wed Sep 01 12:23:51 2010 +0100
+++ b/bearermanagement/mpm/group/mpmserver.mmp	Tue Sep 14 22:06:05 2010 +0300
@@ -58,6 +58,8 @@
 SOURCE            mpmofflinewatcher.cpp
 SOURCE            mpmexpirytimer.cpp
 SOURCE            mpmconnpermquerytimer.cpp
+SOURCE            mpmofflinequerytimer.cpp
+SOURCE            mpmconnselectiondlgtimer.cpp
 
 USERINCLUDE       ../inc
 
--- a/bearermanagement/mpm/inc/mpmcommsdataccess.h	Wed Sep 01 12:23:51 2010 +0100
+++ b/bearermanagement/mpm/inc/mpmcommsdataccess.h	Tue Sep 14 22:06:05 2010 +0300
@@ -300,6 +300,14 @@
         TWlanIapType CheckWlanL( TUint32 aIapId ) const;
 
         /**
+        * Checks if given IAP is TUN driver IAP.
+        * @since S^3
+        * @param aIapId IAP Id.
+        * @return True if given IAP is TUN driver IAP, false otherwise.
+        */
+		TBool IsTunDriverIap( TUint32 aIapId ) const;
+
+        /**
         * Removes categorised IAPs from the list of available IAPs.
         * @since 3.2
         * @param aIAPList List of IAPs
--- a/bearermanagement/mpm/inc/mpmconnmonevents.h	Wed Sep 01 12:23:51 2010 +0100
+++ b/bearermanagement/mpm/inc/mpmconnmonevents.h	Tue Sep 14 22:06:05 2010 +0300
@@ -293,6 +293,13 @@
         inline TBool DiscardAvailabilityNotification(); 
         
         /**
+        * Returns the setting whether IAP availability notification has been discarded by MPM.
+        * @since 3.2
+        * @return ETrue if availability notifications have been discarded. 
+        */
+        inline TBool AvailabilityNotificationDiscarded();
+        
+        /**
          * Creates preferred carrier available notification when needed.
          * @since 5.1
          * @param aCaller Identifies the calling context
@@ -343,6 +350,9 @@
         // until MPM initiated WLAN scan request has completed. 
         TBool iDiscardAvailabilityNotification;
 
+        // ConnMon's IAP availability event has been discarded.
+        TBool iAvailabilityNotificationDiscarded;
+
 #ifdef _DEBUG 
         TBool iFilterEvents; // by default off. (CBase)
     public:
@@ -378,6 +388,15 @@
     return iDiscardAvailabilityNotification;
     }
 
+// -----------------------------------------------------------------------------
+// CMPMConnMonEvents::AvailabilityNotificationDiscarded
+// -----------------------------------------------------------------------------
+//
+inline TBool CMPMConnMonEvents::AvailabilityNotificationDiscarded()
+    {
+    return iAvailabilityNotificationDiscarded;
+    }
+
 #endif // MPMCONNMONEVENTS_H
 
 // End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bearermanagement/mpm/inc/mpmconnselectiondlgtimer.h	Tue Sep 14 22:06:05 2010 +0300
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 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"
+* 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: Declaration of class CMPMConnSelectionDlgTimer.
+*
+*/
+
+#ifndef MPMCONNSELECTIONDLGTIMER_H
+#define MPMCONNSELECTIONDLGTIMER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include "mpmexpirytimercallback.h"
+
+class CMPMServer;
+class CMPMExpiryTimer;
+
+/**
+* Class that implements connection selection dialog's
+* cancellation delay timer and callback.
+* @since 5.2
+*/
+class CMPMConnSelectionDlgTimer : public CBase, public MMPMExpiryTimerCallback
+    {
+
+public:
+
+    /**
+    * New for calling the two-phased constructor.
+    * @since 5.2
+    * @param aServer Pointer to the MPM server object, for callback purposes    
+    * @return Pointer to created object instance
+    */
+    static CMPMConnSelectionDlgTimer* NewL( CMPMServer* aServer );
+
+    /**
+    * Destructor.
+    * @since 5.2
+    */
+    virtual ~CMPMConnSelectionDlgTimer();
+
+    /**
+    * Start the timer.
+    * @since 5.2
+    */
+    void StartTimer();
+
+    /**
+    * Dialog expiration timeout callback, inherited from MMPMExpiryTimerCallback.
+    * @since 5.2
+    */
+    void HandleTimedOut();
+    
+private:
+
+    /**
+    * C++ default constructor.
+    * @since 5.2
+    * @param aServer Pointer to the MPM server object, for callback purposes    
+    */
+    CMPMConnSelectionDlgTimer( CMPMServer* aServer );
+
+    /**
+    * Symbian 2nd phase constructor.
+    * @since 5.2
+    */
+    void ConstructL();
+
+
+private: // data
+
+    /**
+    * Pointer to the MPM Server object. Not own.
+    */
+    CMPMServer* iServer;
+    
+    /**
+    * Pointer to the common MPM expiry timer object.
+    */
+    CMPMExpiryTimer* iExpiryTimer;
+
+    /**
+    * Timeout constant.
+    */
+    static const TInt KTimeout = 10000000; // 10 sec
+
+    };
+
+#endif // MPMCONNSELECTIONDLGTIMER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bearermanagement/mpm/inc/mpmofflinequerytimer.h	Tue Sep 14 22:06:05 2010 +0300
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 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"
+* 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: Declaration of class CMPMOfflineQueryTimer.
+*
+*/
+
+#ifndef MPMOFFLINEQUERYTIMER_H
+#define MPMOFFLINEQUERYTIMER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include "mpmexpirytimercallback.h"
+
+class CMPMServer;
+class CMPMExpiryTimer;
+
+/**
+* Class that implements Offline query's cancellation delay timer
+* and callback.
+* @since 5.2
+*/
+class CMPMOfflineQueryTimer : public CBase, public MMPMExpiryTimerCallback
+    {
+
+public:
+
+    /**
+    * New for calling the two-phased constructor.
+    * @since 5.2
+    * @param aServer Pointer to the MPM server object, for callback purposes    
+    * @return Pointer to created object instance
+    */
+    static CMPMOfflineQueryTimer* NewL( CMPMServer* aServer );
+
+    /**
+    * Destructor.
+    * @since 5.2
+    */
+    virtual ~CMPMOfflineQueryTimer();
+
+    /**
+    * Start the timer.
+    * @since 5.2
+    */
+    void StartTimer();
+
+    /**
+    * Dialog expiration timeout callback, inherited from MMPMExpiryTimerCallback.
+    * @since 5.2
+    */
+    void HandleTimedOut();
+    
+private:
+
+    /**
+    * C++ default constructor.
+    * @since 5.2
+    * @param aServer Pointer to the MPM server object, for callback purposes    
+    */
+    CMPMOfflineQueryTimer( CMPMServer* aServer );
+
+    /**
+    * Symbian 2nd phase constructor.
+    * @since 5.2
+    */
+    void ConstructL();
+
+
+private: // data
+
+    /**
+    * Pointer to the MPM Server object. Not own.
+    */
+    CMPMServer* iServer;
+    
+    /**
+    * Pointer to the common MPM expiry timer object.
+    */
+    CMPMExpiryTimer* iExpiryTimer;
+
+    /**
+    * Timeout constant.
+    */
+    static const TInt KTimeout = 10000000; // 10 sec
+
+    };
+
+#endif // MPMOFFLINEQUERYTIMER_H
--- a/bearermanagement/mpm/inc/mpmserver.h	Wed Sep 01 12:23:51 2010 +0100
+++ b/bearermanagement/mpm/inc/mpmserver.h	Tue Sep 14 22:06:05 2010 +0300
@@ -201,6 +201,8 @@
 class CMPMWlanQueryDialog;
 class CMPMDialog;
 class CMPMConnPermQueryTimer;
+class CMPMOfflineQueryTimer;
+class CMPMConnSelectionDlgTimer;
 
 // CLASS DECLARATION
 /**
@@ -966,7 +968,49 @@
         * @return ETrue if timer is running, EFalse otherwise.
         */
         TBool IsConnPermQueryTimerOn();
+        
+        /**
+        * Starts the offline query timer.
+        * During the timer, offline query can not be initiated.
+        * @since 5.2
+        */
+        void StartOfflineQueryTimer();
 
+        /**
+        * Resets the offline query timer.
+        * @since 5.2
+        */
+        void ResetOfflineQueryTimer();
+
+        /**
+        * Returns true if the offline query timer is running.
+        * During the timer, offline query can not be initiated.
+        * @since 5.2
+        * @return ETrue if timer is running, EFalse otherwise.
+        */
+        TBool IsOfflineQueryTimerOn();
+        
+        /**
+        * Starts the connection selection dialog timer.
+        * During the timer, connection selection dialog can not be initiated.
+        * @since 5.2
+        */
+         void StartConnSelectionDlgTimer();
+
+        /**
+        * Resets the connection selection dialog timer.
+        * @since 5.2
+        */
+         void ResetConnSelectionDlgTimer();
+
+        /**
+        * Returns true if the connection selection dialog timer is running.
+        * During the timer, connection selection dialog can not be initiated.
+        * @since 5.2
+        * @return ETrue if timer is running, EFalse otherwise.
+        */
+         TBool IsConnSelectionDlgTimerOn();
+         
     private:
 
         /**
@@ -1001,6 +1045,7 @@
          * @param aIapId Iap id for checking
          */
         void CheckIapForDisconnect( TInt aIapId );
+        
 
     private: // Data
         // Pointer to the ConnMonEvents object
@@ -1119,6 +1164,13 @@
         
         // Connection permission query cancellation delay timer
         CMPMConnPermQueryTimer* iConnPermQueryTimer;
+        
+        // Offline query cancellation delay timer
+        CMPMOfflineQueryTimer* iOfflineQueryTimer;
+        
+        // Connection selection dialog cancellation delay timer         
+        CMPMConnSelectionDlgTimer* iConnSelectionDlgTimer;
+      
     };
 
 #include "mpmserver.inl"
--- a/bearermanagement/mpm/src/mpmcommsdataccess.cpp	Wed Sep 01 12:23:51 2010 +0100
+++ b/bearermanagement/mpm/src/mpmcommsdataccess.cpp	Tue Sep 14 22:06:05 2010 +0300
@@ -1787,6 +1787,34 @@
     }
 
 // -----------------------------------------------------------------------------
+// CMPMCommsDatAccess::IsTunDriverIap
+// -----------------------------------------------------------------------------
+//
+TBool CMPMCommsDatAccess::IsTunDriverIap( TUint32 aIapId ) const
+    {
+    TBool isTunDriver = EFalse;
+    MPMLOGSTRING( "CMPMCommsDatAccess::IsTunDriverIap" )
+
+    CMDBSession* db = CMDBSession::NewLC( KCDVersion1_1 );
+    CCDIAPRecord* record = LoadIapRecordLC( aIapId, db );
+
+    TBuf<KMaxTextLength> bearerTypeName( record->iBearerType.GetL() );
+    TBuf<KMaxTextLength> serviceTypeName( record->iServiceType.GetL() );
+
+    if ( (bearerTypeName == TPtrC( KCDTypeNameVirtualBearer ) )
+            && ( serviceTypeName == TPtrC( KCDTypeNameLANService ) ) )
+        {
+        // TunDriver;
+        isTunDriver = ETrue;
+        }
+
+    CleanupStack::PopAndDestroy( record );
+    CleanupStack::PopAndDestroy( db );
+
+    return isTunDriver;
+    }
+
+// -----------------------------------------------------------------------------
 // CMPMCommsDatAccess::RemoveCategorisedIapsL
 // -----------------------------------------------------------------------------
 //
--- a/bearermanagement/mpm/src/mpmconnmonevents.cpp	Wed Sep 01 12:23:51 2010 +0100
+++ b/bearermanagement/mpm/src/mpmconnmonevents.cpp	Tue Sep 14 22:06:05 2010 +0300
@@ -51,7 +51,8 @@
 // 
 CMPMConnMonEvents::CMPMConnMonEvents( CMPMServer& aServer )
     : iMyServer( aServer ),
-      iDiscardAvailabilityNotification( EFalse )
+      iDiscardAvailabilityNotification( EFalse ),
+      iAvailabilityNotificationDiscarded( EFalse )
     {
     }
 
@@ -466,6 +467,7 @@
     if ( ( iAvailableIAPs.Count() > 0 ) && 
          !DiscardAvailabilityNotification() )
         {
+        iAvailabilityNotificationDiscarded = EFalse;
         // Remove temporary blacklistings as fresh availability 
         // info is available.
         // 
@@ -479,6 +481,7 @@
         }
     else
         {
+        iAvailabilityNotificationDiscarded = ETrue;
         MPMLOGSTRING2( "CMPMConnMonEvents::EventL - IAPs count: %d", 
             iAvailableIAPs.Count() )
         MPMLOGSTRING2( 
--- a/bearermanagement/mpm/src/mpmconnmonreqs.cpp	Wed Sep 01 12:23:51 2010 +0100
+++ b/bearermanagement/mpm/src/mpmconnmonreqs.cpp	Tue Sep 14 22:06:05 2010 +0300
@@ -347,6 +347,12 @@
                         //
                         iParent.IapAvailabilityChange( EConnMon );
                         }
+
+                    if ( iParent.AvailabilityNotificationDiscarded() )
+                        {
+                        MPMLOGSTRING( "CMPMConnMonReqs::RunL: AvailabilityNotificationDiscarded, roaming logic triggered" )
+                        iParent.IapAvailabilityChange( EConnMonEvent );
+                        }
                     }
                 // check which callback function to use
                 // 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bearermanagement/mpm/src/mpmconnselectiondlgtimer.cpp	Tue Sep 14 22:06:05 2010 +0300
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 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"
+ * 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: Implementation of class CMPMConnSelectionDlgTimer.
+ * This timer is used for preventing showing of connection selection
+ * dialog when the user has cancelled the previous selection dialog.
+ *
+ */
+
+#include "mpmlogger.h"
+#include "mpmserver.h"
+#include "mpmexpirytimer.h"
+#include "mpmconnselectiondlgtimer.h"
+
+// ---------------------------------------------------------------------------
+// Creates a new object by calling the two-phased constructor.
+// ---------------------------------------------------------------------------
+//
+CMPMConnSelectionDlgTimer* CMPMConnSelectionDlgTimer::NewL( CMPMServer* aServer )
+    {
+    MPMLOGSTRING( "CMPMConnSelectionDlgTimer::NewL" )
+            
+    CMPMConnSelectionDlgTimer* self = new( ELeave ) CMPMConnSelectionDlgTimer( aServer );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Default C++ constructor.
+// ---------------------------------------------------------------------------
+//
+CMPMConnSelectionDlgTimer::CMPMConnSelectionDlgTimer( CMPMServer* aServer ) :
+    iServer( aServer )
+    {
+    MPMLOGSTRING( "CMPMConnSelectionDlgTimer::CMPMConnSelectionDlgTimer" )
+    }
+
+// ---------------------------------------------------------------------------
+// Symbian 2nd phase constructor.
+// ---------------------------------------------------------------------------
+//
+void CMPMConnSelectionDlgTimer::ConstructL()
+    {
+    MPMLOGSTRING( "CMPMConnSelectionDlgTimer::ConstructL" )
+    iExpiryTimer = CMPMExpiryTimer::NewL( *this, KTimeout );
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------------------------
+//
+CMPMConnSelectionDlgTimer::~CMPMConnSelectionDlgTimer()
+    {
+    MPMLOGSTRING( "CMPMConnSelectionDlgTimer::~CMPMConnSelectionDlgTimer" )
+    if ( iExpiryTimer )
+        {
+        iExpiryTimer->Cancel();
+        delete iExpiryTimer;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Start the timer.
+// ---------------------------------------------------------------------------
+//
+void CMPMConnSelectionDlgTimer::StartTimer()
+    {
+    MPMLOGSTRING( "CMPMConnSelectionDlgTimer::StartTimer" )
+    if ( iExpiryTimer )
+        {
+        iExpiryTimer->Cancel();
+        iExpiryTimer->Start();    
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Handles the timeout.
+// ---------------------------------------------------------------------------
+//
+void CMPMConnSelectionDlgTimer::HandleTimedOut()
+    {
+    MPMLOGSTRING( "CMPMConnSelectionDlgTimer::HandleTimedOut" )
+    iServer->ResetConnSelectionDlgTimer();
+    }
--- a/bearermanagement/mpm/src/mpmiapselection.cpp	Wed Sep 01 12:23:51 2010 +0100
+++ b/bearermanagement/mpm/src/mpmiapselection.cpp	Tue Sep 14 22:06:05 2010 +0300
@@ -835,6 +835,13 @@
     ChooseIapComplete( aError, NULL );
     delete iDialog;
     iDialog = NULL;
+    // Start ConnSelectionDlgTimer if user has cancelled the connection
+    // selection dialog. During the timer interval dialog is not shown.
+    // 
+    if( aError == KErrCancel )
+        {
+        iSession->MyServer().StartConnSelectionDlgTimer();
+        }
     }
 
        
@@ -1022,13 +1029,22 @@
     MPMLOGSTRING( "CMPMIapSelection::ImplicitConnectionIapSelectionL" )
     iSession->AvailableUnblacklistedIapsL( iStoredAvailableIaps, iSession->ConnectionId() );
 
-    // Create and initiate user dialog
+    // Create and initiate user dialog only if it hasnot 
+    // been cancelled in last 10s(KTimeout)
     //
-    iDialog = CMPMDialog::NewL( *this,
+    if ( !iSession->MyServer().IsConnSelectionDlgTimerOn() )
+        {
+       iDialog = CMPMDialog::NewL( *this,
                                 iStoredAvailableIaps,
                                 iChooseIapPref.BearerSet(),
                                 *iSession->MyServer().ConnectDialogQueue(),
                                 iSession->MyServer() );
+        }
+    else
+        {
+        MPMLOGSTRING( "CMPMIapSelection::ImplicitConnectionIapSelectionL, iConnSelectionDlgTimer running" )	
+        ChooseIapComplete( KErrCancel, NULL );        
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -1136,9 +1152,14 @@
         ret = aAvailableIAPs.Find( destNetIaps[k].iIapId );
         if ( ret == KErrNotFound )
             {
-            MPMLOGSTRING2( "CMPMIapSelection::ChooseBestIAPL: \
-Remove unavailable IAP = %i", destNetIaps[k].iIapId )
-            destNetIaps.Remove( k );
+            TBool isTunDriver = iCommsDatAccess->IsTunDriverIap(
+                    destNetIaps[k].iIapId );
+            if ( !isTunDriver )
+                {
+                MPMLOGSTRING2( "CMPMIapSelection::ChooseBestIAPL: \
+                     Remove unavailable IAP = %i", destNetIaps[k].iIapId )
+                destNetIaps.Remove( k );
+                }
             }
         }
 
@@ -1154,11 +1175,14 @@
             ret = aAvailableIAPs.Find( embeddedIaps[m].iIapId );
             if ( ret == KErrNotFound )
                 {
-                // Remove IapId because it's not available
-                // 
-                MPMLOGSTRING2( "CMPMIapSelection::ChooseBestIAPL: \
+                TBool isTunDriver = iCommsDatAccess->IsTunDriverIap( embeddedIaps[m].iIapId );
+                if ( !isTunDriver )
+                    {
+                    // Remove IapId because it's not available
+                    MPMLOGSTRING2( "CMPMIapSelection::ChooseBestIAPL: \
 Remove unavailable IAP = %i", embeddedIaps[m].iIapId )
-                              embeddedIaps.Remove( m );
+                                   embeddedIaps.Remove( m );
+                    }
                 }
             }
         }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bearermanagement/mpm/src/mpmofflinequerytimer.cpp	Tue Sep 14 22:06:05 2010 +0300
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 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"
+ * 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: Implementation of class CMPMOfflineQueryTimer.
+ * This timer is used for preventing offline query when the user
+ * has cancelled the previous offline query.
+ *
+ */
+
+#include "mpmlogger.h"
+#include "mpmserver.h"
+#include "mpmexpirytimer.h"
+#include "mpmofflinequerytimer.h"
+
+// ---------------------------------------------------------------------------
+// Creates a new object by calling the two-phased constructor.
+// ---------------------------------------------------------------------------
+//
+CMPMOfflineQueryTimer* CMPMOfflineQueryTimer::NewL( CMPMServer* aServer )
+    {
+    MPMLOGSTRING( "CMPMOfflineQueryTimer::NewL" )
+            
+    CMPMOfflineQueryTimer* self = new( ELeave ) CMPMOfflineQueryTimer( aServer );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Default C++ constructor.
+// ---------------------------------------------------------------------------
+//
+CMPMOfflineQueryTimer::CMPMOfflineQueryTimer( CMPMServer* aServer ) :
+    iServer( aServer )
+    {
+    MPMLOGSTRING( "CMPMOfflineQueryTimer::CMPMOfflineQueryTimer" )
+    }
+
+// ---------------------------------------------------------------------------
+// Symbian 2nd phase constructor.
+// ---------------------------------------------------------------------------
+//
+void CMPMOfflineQueryTimer::ConstructL()
+    {
+    MPMLOGSTRING( "CMPMOfflineQueryTimer::ConstructL" )
+    iExpiryTimer = CMPMExpiryTimer::NewL( *this, KTimeout );
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------------------------
+//
+CMPMOfflineQueryTimer::~CMPMOfflineQueryTimer()
+    {
+    MPMLOGSTRING( "CMPMOfflineQueryTimer::~CMPMOfflineQueryTimer" )
+    if ( iExpiryTimer )
+        {
+        iExpiryTimer->Cancel();
+        delete iExpiryTimer;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Start the timer.
+// ---------------------------------------------------------------------------
+//
+void CMPMOfflineQueryTimer::StartTimer()
+    {
+    MPMLOGSTRING( "CMPMOfflineQueryTimer::StartTimer" )
+    if ( iExpiryTimer )
+        {
+        iExpiryTimer->Cancel();
+        iExpiryTimer->Start();    
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Handles the timeout.
+// ---------------------------------------------------------------------------
+//
+void CMPMOfflineQueryTimer::HandleTimedOut()
+    {
+    MPMLOGSTRING( "CMPMOfflineQueryTimer::HandleTimedOut" )
+    iServer->ResetOfflineQueryTimer();
+    }
--- a/bearermanagement/mpm/src/mpmserver.cpp	Wed Sep 01 12:23:51 2010 +0100
+++ b/bearermanagement/mpm/src/mpmserver.cpp	Tue Sep 14 22:06:05 2010 +0300
@@ -47,6 +47,8 @@
 #include "mpmpropertydef.h"
 #include "mpmofflinewatcher.h"
 #include "mpmconnpermquerytimer.h"
+#include "mpmofflinequerytimer.h"
+#include "mpmconnselectiondlgtimer.h"
 
 // ============================= LOCAL FUNCTIONS ===============================
 
@@ -381,6 +383,10 @@
     delete iCommsDatAccess;
     
     delete iConnPermQueryTimer;
+    
+    delete iOfflineQueryTimer; 
+    
+    delete iConnSelectionDlgTimer;
     }
 
 
@@ -1956,6 +1962,10 @@
         // cancel the periodic object        
         self->iRoamingToWlanPeriodic->Cancel();
         self->StartForcedRoamingToWlanL( self->iConnMonIapInfo );
+        // Added also execution of policy based roaming logic because
+        // connections that are in EStarting state, when WLAN signal
+        // gets weak, would remain in WLAN as long as signal is weak. 
+        self->StartForcedRoamingFromWlanL( self->iConnMonIapInfo );
         }
     return 0;
     }
@@ -1973,6 +1983,10 @@
         // cancel the periodic object
         self->iRoamingToHotspotWlanPeriodic->Cancel();
         self->StartForcedRoamingToWlanL( self->iConnMonIapInfo );
+        // Added also execution of policy based roaming logic because
+        // connections that are in EStarting state, when WLAN signal
+        // gets weak, would remain in WLAN as long as signal is weak. 
+        self->StartForcedRoamingFromWlanL( self->iConnMonIapInfo );
         }
     return 0;
     }
@@ -2379,6 +2393,116 @@
     return retval;
     }
 
+// ---------------------------------------------------------------------------
+// CMPMServer::StartOfflineQueryTimer
+// Starts the offline query timer.
+// ---------------------------------------------------------------------------
+//
+void CMPMServer::StartOfflineQueryTimer()
+    {
+    MPMLOGSTRING( "CMPMServer::StartOfflineQueryTimer" )
+
+    if ( !iOfflineQueryTimer )
+        {
+        TRAPD( err, iOfflineQueryTimer = CMPMOfflineQueryTimer::NewL( this ) );
+        if ( err == KErrNone )
+            {
+            iOfflineQueryTimer->StartTimer();
+            MPMLOGSTRING( "CMPMServer::StartOfflineQueryTimer: Ok." )
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CMPMServer::ResetOfflineQueryTimer
+// Resets the offline query timer.
+// ---------------------------------------------------------------------------
+//
+void CMPMServer::ResetOfflineQueryTimer()
+    {
+    MPMLOGSTRING( "CMPMServer::ResetOfflineQueryTimer" )
+
+    if ( iOfflineQueryTimer )
+        {
+        delete iOfflineQueryTimer;
+        iOfflineQueryTimer = NULL;
+        MPMLOGSTRING( "CMPMServer::ResetOfflineQueryTimer: Ok." )
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CMPMServer::IsOfflineQueryTimerOn
+// Tells if the offline query timer is on.
+// ---------------------------------------------------------------------------
+//
+TBool CMPMServer::IsOfflineQueryTimerOn()
+    {
+    MPMLOGSTRING( "CMPMServer::IsOfflineQueryTimerOn" )
+
+    TBool retval = EFalse;
+    if ( iOfflineQueryTimer )
+        {
+        retval = ETrue;
+        MPMLOGSTRING( "CMPMServer::IsOfflineQueryTimerOn: Yes." )
+        }
+    return retval;
+    }
+
+// ---------------------------------------------------------------------------
+// CMPMServer::StartConnSelectionDlgTimer
+// Starts the connection selection dialog timer.
+// ---------------------------------------------------------------------------
+//
+void CMPMServer::StartConnSelectionDlgTimer()
+    {
+    MPMLOGSTRING( "CMPMServer::StartConnSelectionDlgTimer" )
+
+    if ( !iConnSelectionDlgTimer )
+        {
+        TRAPD( err, iConnSelectionDlgTimer = CMPMConnSelectionDlgTimer::NewL( this ) );
+        if ( err == KErrNone )
+            {
+            iConnSelectionDlgTimer->StartTimer();
+            MPMLOGSTRING( "CMPMServer::StartConnSelectionDlgTimer: Ok." )
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CMPMServer::ResetConnSelectionDlgTimer
+// Resets the connection selection dialog timer.
+// ---------------------------------------------------------------------------
+//
+void CMPMServer::ResetConnSelectionDlgTimer()
+    {
+    MPMLOGSTRING( "CMPMServer::ResetConnSelectionDlgTimer" )
+
+    if ( iConnSelectionDlgTimer )
+        {
+        delete iConnSelectionDlgTimer;
+        iConnSelectionDlgTimer = NULL;
+        MPMLOGSTRING( "CMPMServer::ResetConnSelectionDlgTimer: Ok." )
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CMPMServer::IsConnSelectionDlgTimerOn
+// Tells if the connection selection dialog timer is on.
+// ---------------------------------------------------------------------------
+//
+TBool CMPMServer::IsConnSelectionDlgTimerOn()
+    {
+    MPMLOGSTRING( "CMPMServer::IsConnSelectionDlgTimerOn" )
+
+    TBool retval = EFalse;
+    if ( iConnSelectionDlgTimer )
+        {
+        retval = ETrue;
+        MPMLOGSTRING( "CMPMServer::IsConnSelectionDlgTimerOn: Yes." )
+        }
+    return retval;
+    }
+    
 // -----------------------------------------------------------------------------
 // CMPMServer::CheckIapForDisconnect
 // -----------------------------------------------------------------------------
--- a/bearermanagement/mpm/src/mpmwlanquerydialog.cpp	Wed Sep 01 12:23:51 2010 +0100
+++ b/bearermanagement/mpm/src/mpmwlanquerydialog.cpp	Tue Sep 14 22:06:05 2010 +0300
@@ -207,6 +207,7 @@
             {
             iIapSelection.Session()->MyServer().SetOfflineWlanQueryResponse(
                     EOfflineResponseNo );
+            iIapSelection.Session()->MyServer().StartOfflineQueryTimer();
             MPMLOGSTRING2( "CMPMWlanQueryDialog::RunL offline query returned %d", 
                            iStatus.Int() )
             }
@@ -474,14 +475,22 @@
             iIapSelection.UserWlanSelectionDoneL( KErrPermissionDenied, iWlanIapId );
             }
         else
-            {
-            MPMLOGSTRING( "CMPMWlanQueryDialog::StartWlanQuery, starting offline note" )            
+            {         
             iWlanQueryState = EOffline;
-            iNotifier.StartNotifierAndGetResponse( iStatus, 
-                                                   KUidCOfflineWlanNoteDlg, 
-                                                   KNullDesC8(), 
-                                                   iOfflineReply );
-            SetActive();
+            if ( !iIapSelection.Session()->MyServer().IsOfflineQueryTimerOn() )
+                {
+                MPMLOGSTRING( "CMPMWlanQueryDialog::StartWlanQuery, starting offline query" )        
+                iNotifier.StartNotifierAndGetResponse( iStatus, 
+                                                       KUidCOfflineWlanNoteDlg, 
+                                                       KNullDesC8(), 
+                                                       iOfflineReply );
+                SetActive();
+                }
+            else
+                {
+                MPMLOGSTRING( "CMPMWlanQueryDialog::StartWlanQuery, offline note not shown as OfflineQueryTimer is active" )        
+                iIapSelection.UserWlanSelectionDoneL( KErrPermissionDenied, iWlanIapId );
+                }
             }
         }
     // if easy wlan iap and some wlan iap started, use existing connection
--- a/cmmanager/cmmgr/Plugins/Group/bld.inf	Wed Sep 01 12:23:51 2010 +0100
+++ b/cmmanager/cmmgr/Plugins/Group/bld.inf	Tue Sep 14 22:06:05 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006-2008 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"
@@ -32,5 +32,6 @@
 #include "../cmpluginwlan/group/bld.inf"
 #include "../cmpluginembdestination/group/bld.inf"
 #include "../cmpluginvpn/group/bld.inf"
+#include "../cmplugintundriver/group/bld.inf"
 
 // End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cmmanager/cmmgr/Plugins/cmplugintundriver/data/20027F3E.rss	Tue Sep 14 22:06:05 2010 +0300
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 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"
+* 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:  ECom resource descriptor for TUN Driver plug-in
+*
+*/
+
+#include "ecom/registryinfo.rh"
+
+// Because attribute enums had to be added to namespace CMManager
+// it's not possible to included cmplugintundriverdef.h.
+// Thus bearer type id had to be redefined here.
+#define KPluginTUNDriverBearerTypeUid   0x20027F3F
+
+RESOURCE REGISTRY_INFO theInfo
+    {
+    dll_uid = 0x20027F3E;
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            interface_uid = 0x10207377; // = KCMPluginInterfaceUid. Do NOT modify it!!!
+            implementations = 
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = KPluginTUNDriverBearerTypeUid;
+                    version_no = 1;
+                    display_name = "VPN";
+                    default_data = "VPN";
+                    opaque_data = "";
+                    }
+                };
+            }
+        };
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cmmanager/cmmgr/Plugins/cmplugintundriver/group/bld.inf	Tue Sep 14 22:06:05 2010 +0300
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 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"
+* 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:  TUN Driver plug-in IF implementation class.
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+// export localised loc file
+
+PRJ_MMPFILES
+cmplugintundriver.mmp
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+OPTION TARGETFILE cmplugintundriver.mif
+OPTION HEADERFILE cmpluginvpn.mbg
+OPTION SOURCES -c8,1 qgn_prop_vpn_access_point
+END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cmmanager/cmmgr/Plugins/cmplugintundriver/group/cmplugintundriver.mmp	Tue Sep 14 22:06:05 2010 +0300
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 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"
+* 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:  Project specification for TUN Driver plug-in
+*
+*/
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+TARGET      cmplugintundriver.dll
+UID         0x10009D8D 0x20027F3E
+
+TARGETTYPE        PLUGIN
+
+CAPABILITY      CAP_ECOM_PLUGIN
+VENDORID        VID_DEFAULT
+
+SOURCEPATH  ../src
+
+SOURCE      cmpluginproxytundriver.cpp
+SOURCE      cmplugintundriver.cpp
+SOURCE      ../../../Framework/Src/cmlogger.cpp
+
+SOURCEPATH  ../data
+
+START RESOURCE 20027F3E.rss
+TARGET cmplugintundriver.rsc
+END
+
+
+USERINCLUDE     ../data
+USERINCLUDE     ../../../Framework/Inc
+USERINCLUDE     ../../../Framework/SrcData
+
+// Component specific internal headers 
+USERINCLUDE			../inc
+
+// ADO specific internal headers 
+SYSTEMINCLUDE		../../../../../inc
+
+//Macro to /epoc32 headers
+MW_LAYER_SYSTEMINCLUDE
+
+#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
+APP_LAYER_SYSTEMINCLUDE
+#endif
+
+LIBRARY hlplch.lib
+LIBRARY euser.lib
+LIBRARY ecom.lib
+LIBRARY cmmanager.lib
+LIBRARY commsdat.lib
+
+LIBRARY aknskins.lib
+LIBRARY efsrv.lib 
+LIBRARY	CommonEngine.lib
+LIBRARY cone.lib eikcore.lib avkon.lib
+LIBRARY eikcoctl.lib eikdlg.lib
+LIBRARY bafl.lib
+LIBRARY vpnapi.lib
+LIBRARY centralrepository.lib
+LIBRARY featmgr.lib
+LIBRARY cmmanagerdatabase.lib
+DEBUGLIBRARY flogger.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cmmanager/cmmgr/Plugins/cmplugintundriver/group/cmplugintundriver_icons.mk	Tue Sep 14 22:06:05 2010 +0300
@@ -0,0 +1,66 @@
+#
+# Copyright (c) 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"
+# 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:  Makefile for icons of TUN Driver plug-in
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z
+else
+ZDIR=\epoc32\data\z
+endif
+
+
+TARGETDIR=$(ZDIR)\resource\apps
+ICONTARGETFILENAME=$(TARGETDIR)\cmpluginvpn.mif
+
+HEADERDIR=\epoc32\include
+HEADERFILENAME=$(HEADERDIR)\cmpluginvpn.mbg
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+# ----------------------------------------------------------------------------
+# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
+# MifConv if the mask detph is defined.
+#
+# NOTE 2: Usually, source paths should not be included in the bitmap
+# definitions. MifConv searches for the icons in all icon directories in a
+# predefined order, which is currently \s60\icons, \s60\bitmaps2, \s60\bitmaps.
+# The directory \s60\icons is included in the search only if the feature flag
+# __SCALABLE_ICONS is defined.
+# ----------------------------------------------------------------------------
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \
+                /c8,1 qgn_prop_vpn_access_point.bmp
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(HEADERFILENAME)&& \
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cmmanager/cmmgr/Plugins/cmplugintundriver/inc/cmplugintundriver.h	Tue Sep 14 22:06:05 2010 +0300
@@ -0,0 +1,165 @@
+/*
+* Copyright (c) 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"
+* 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:  TUN Driver plugin IF implementation class.
+*
+*/
+
+#ifndef TUNDRIVER_PLUGIN_INCLUDED
+#define TUNDRIVER_PLUGIN_INCLUDED
+
+#include <cmplugintundriverdef.h>
+#include <cmpluginlanbase.h>
+
+class CCDVirtualIAPNextLayerRecord;
+
+/**
+ * TUN Driver Plugin IF implementation class
+ * This class will be instantiated when the connection is created using the PluginBearer Id KPluginTUNDriverBearerTypeUid
+ * @since S^3
+ */
+NONSHARABLE_CLASS(CCmPluginTUNDriver) : public CCmPluginLanBase
+    {
+
+    public:
+
+        /**
+        * This function is invoked by the cmmanager plugin framework to load TUNDriver plugin. 
+        * This plugin will be identified based on the plugin UID from cmpluginproxy.cpp
+        * @param aInitParam Initialization parameters.
+        * @return CCmPluginTUNDriver.
+        */
+        static CCmPluginTUNDriver* NewL( TCmPluginInitParam* aInitParam );
+
+        /**
+        * Destructor. 
+        */
+        virtual ~CCmPluginTUNDriver();
+
+        /**
+        * This function is invoked by the cmmanager plugin framework while loading the plugin. 
+        * CreateInstance of the plugin will invoke each time plugin type needs to instantiated 
+        * @param aInitParam Initialization parameters.
+        * @return CCmPluginBaseEng.
+        */
+        virtual CCmPluginBaseEng* CreateInstanceL( TCmPluginInitParam& aInitParam ) const;
+        
+        /**
+        * This is function is invoked by cmmanager framework.
+        * Once the plugin type is identified, identifies the right ServiceRecord and loads.
+        */
+        void LoadServiceSettingL();
+        
+    public:
+
+        /**
+        * This is function is invoked by cmmanager framework.
+        * Check here if every data of the connection method is valid
+        * before records were saved to CommsDat.
+        * Set incorrect attribute id in iInvalidAttribute and leave
+        * with KErrArgument.
+        */
+        void PrepareToUpdateRecordsL();
+        
+        /**
+        * This is function is invoked by cmmanager framework. If Settings are enabled.
+        * Currently Settings for TUNDriver is not supported.
+        * @return KErrNotSupported.
+        */
+        virtual TInt RunSettingsL();
+
+        /**
+        * This is function is invoked by cmmanager framework.
+        * Once the plugin type is identified, type of bearer and other attributes types are obtained. 
+        * @param aAttribute Attribute type.
+        * @return Integer attribute's value.
+        */
+        virtual TUint32 GetIntAttributeL( const TUint32 aAttribute ) const;
+        
+        /**
+        * This is function is invoked by cmmanager framework.
+        * Once the plugin type is identified, finds wether the IAP selected belongs to TUNDriver. 
+        * @param aIapId IapId for the selected accesspoint
+        * @return ETrue if IAP can be handled else EFalse.
+        */
+        virtual TBool CanHandleIapIdL( TUint32 aIapId ) const;
+        
+        /**
+        * This is function is invoked by cmmanager framework.
+        * Once the plugin type is identified, finds wether the IAP selected belongs to TUNDriver.
+        * This is identified if service type is LANService and Bearer is VirtualBearer and
+        * IfName is TunDriverIf and agent is TunDriverAgent. 
+        * @param aIapRecord - iaprecord of type CCDIAPRecord from commsdatabase
+        * @return ETrue if IAP can be handled else EFalse.
+        */
+        virtual TBool CanHandleIapIdL( CommsDat::CCDIAPRecord* aIapRecord ) const;
+        
+        /**
+        * This is function is invoked by cmmanager framework when needs to initialzed with UI.
+        * This feature is currently not supported by the plugin.
+        * @param aManuallyConfigure Manual configuration on or off.
+        * @return KErrNotSupported
+        */
+        TBool InitializeWithUiL( TBool aManuallyConfigure );
+
+        /**
+        * This is function is invoked by plugin destructor.
+        * If the function is not defined then compiler will throw error for TUNDriver plugin construction.
+        */
+        virtual void AdditionalReset();
+
+    protected:
+
+        /**
+        * This is function is invoked by cmmanager framework.
+        * @return aName is LanService name and  aRecordId the service record Id.
+        */
+        virtual void ServiceRecordIdLC( HBufC* &aServiceName, TUint32& aRecordId );
+
+        /**
+        * This is function is invoked by cmmanager framework.
+        * @param aBearerName Output parameter for bearer name.
+        * @param aRecordId Output parameter for Bearer record Id.
+        */
+        virtual void BearerRecordIdLC( HBufC* &aBearerName, TUint32& aRecordId );
+
+        /**
+        * This is function is invoked by cmmanager framework.
+        * Once the plugin type is identified, this invoked for the first time when plgun is loaded
+        * while creating connection for TUNDriver plugin.
+        */
+        virtual void CreateNewServiceRecordL();
+        
+    private:
+
+        /**
+        * This is default constructor of the plugin. 
+        * @param aInitParam Initialization parameters.
+        */
+        CCmPluginTUNDriver( TCmPluginInitParam* aInitParam );
+
+        /**
+        * This is second phase constructor of the plugin.
+        * Builds the commsdatabase with the Tables required for TUNDriver plugin. 
+        */
+        void ConstructL();
+
+        /**
+        * This is function is invoked by cmmanager framework.
+        * Returns the service record of the TUN driver plugin.
+        * @return service record.
+        */
+        CommsDat::CCDLANServiceRecord& ServiceRecord()const;
+    };
+
+#endif // TUNDRIVER_PLUGIN_INCLUDED
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cmmanager/cmmgr/Plugins/cmplugintundriver/inc/cmtundrivercommonconstants.h	Tue Sep 14 22:06:05 2010 +0300
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 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"
+* 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:  constants for the TUN Driver plugin
+*
+*/
+
+#ifndef CMTUNDRIVERCOMMONCONSTANTS_H
+#define CMTUNDRIVERCOMMONCONSTANTS_H
+
+// CONSTANTS
+_LIT( KPluginVPNResDirAndFileName, "z:cmpluginvpnui.rsc" );
+
+// Do not change this default to other value because proxy number is using this value as default port number
+const TInt KVpnProxyPortNumberDefault = 0;
+
+#endif  // CMTUNDRIVERCOMMONCONSTANTS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cmmanager/cmmgr/Plugins/cmplugintundriver/src/cmpluginproxytundriver.cpp	Tue Sep 14 22:06:05 2010 +0300
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 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"
+* 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:  TUN Driver plug-in IF implementation class.
+*
+*/
+
+#include "cmplugintundriver.h"
+#include <e32std.h>
+#include <ecom/implementationproxy.h>
+
+// Exported proxy for instantiation method resolution
+// Define the interface UIDs
+const TImplementationProxy ImplementationTable[] = 
+    {
+    IMPLEMENTATION_PROXY_ENTRY( KPluginTUNDriverBearerTypeUid, CCmPluginTUNDriver::NewL)
+    };
+
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+/**
+* ImplementationGroupProxy
+* This is function is invoked by E-Com Plugin framework for TUNDriver plugin UID when needs to be loaded.
+* @param 
+* @return 
+*/
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+
+    return ImplementationTable;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cmmanager/cmmgr/Plugins/cmplugintundriver/src/cmplugintundriver.cpp	Tue Sep 14 22:06:05 2010 +0300
@@ -0,0 +1,472 @@
+/*
+* Copyright (c) 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"
+* 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:  TUN Driver plug-in IF implementation class.
+*
+*/
+
+#include <AknsUtils.h>
+#include <cmpluginvpn.mbg>
+#include <data_caging_path_literals.hrh>
+
+#include "cmlogger.h"
+#include "cmdestinationimpl.h"
+#include "cmplugintundriver.h"
+
+using namespace CMManager;
+using namespace CommsDat;
+
+const TUint32 KDefaultPriorityTUNDriver = 0;
+_LIT( KPluginTUNDriverFileIcons, "z:cmplugintundriver.mbm" );
+_LIT(KTUNDriverBearerName,"TUNDriverBearer");
+#define KCDAgentNameTUNDriver _S("tundriveragt.agt")
+_LIT(KTUNDriverTunnelAgent,"tundriveragt.agt");
+#define KCDInterfaceNameTUNDriver  _S("tundriver")
+_LIT(KTUNDriverInterfaceName,"tundriver");
+
+const TInt KLanLastSocketActivityTimeout = -1;
+const TInt KLanLastSocketClosedTimeout = -1;
+
+const TBool KDefIpAddrFromServer = EFalse;
+const TBool KDefIpDnsAddrFromServer = EFalse;
+const TBool KDefIp6DnsAddrFromServer = EFalse;
+_LIT( KEmpty, "");
+
+static const TCmAttribConvTable STUNDriverConvTbl[] = 
+    {      
+        { ETUNDriverIfNetworks, ETUNDriverRangeMax, NULL },
+        { ETUNDriverIfNetworks, KCDTIdLANIfNetworks, NULL },        
+        { ETUNDriverIpNetMask, KCDTIdLANIpNetMask, &CheckIPv4ValidityL },
+        { ETUNDriverIpGateway, KCDTIdLANIpGateway, &CheckIPv4ValidityL },
+        { ETUNDriverIpAddrFromServer, KCDTIdLANIpAddrFromServer, NULL },
+        { ETUNDriverIpAddr, KCDTIdLANIpAddr, &CheckIPv4ValidityL },
+        { ETUNDriverIpDNSAddrFromServer, KCDTIdLANIpDNSAddrFromServer, NULL },
+        { ETUNDriverIpNameServer1, KCDTIdLANIpNameServer1, &CheckIPv4ValidityL },
+        { ETUNDriverIpNameServer2, KCDTIdLANIpNameServer2, &CheckIPv4ValidityL },
+        { ETUNDriverIp6DNSAddrFromServer, KCDTIdLANIp6DNSAddrFromServer, NULL },
+        { ETUNDriverIp6NameServer1, KCDTIdLANIp6NameServer1, &CheckIPv4ValidityL },
+        { ETUNDriverIp6NameServer2, KCDTIdLANIp6NameServer2, &CheckIPv4ValidityL },
+        { ETUNDriverIpAddrLeaseValidFrom, KCDTIdLANIpAddrLeaseValidFrom, NULL },
+        { ETUNDriverIpAddrLeaseValidTo, KCDTIdLANIpAddrLeaseValidTo, NULL },
+        { ETUNDriverConfigDaemonManagerName, KCDTIdLANConfigDaemonManagerName, NULL },
+        { ETUNDriverConfigDaemonName, KCDTIdLANConfigDaemonName, NULL },
+        { ETUNDriverServiceExtensionTableName, KCDTIdLANServiceExtensionTableName, NULL },
+        { ETUNDriverServiceExtensionTableRecordId, KCDTIdLANServiceExtensionTableRecordId, NULL },
+        { 0, 0, NULL }
+    };
+
+static const TCmCommonAttrConvArrayItem STUNDriverCommonConvTbl[] =
+    {        
+        { ETUNDriverIfNetworks, ECmIFNetworks },
+        { ETUNDriverIpNetMask, ECmIPNetmask },
+        { ETUNDriverIpGateway, ECmIPGateway },
+        { ETUNDriverIpAddrFromServer, ECmIPAddFromServer },
+        { ETUNDriverIpAddr, ECmIPAddress },
+        { ETUNDriverIpDNSAddrFromServer, ECmIPDNSAddrFromServer },
+        { ETUNDriverIpNameServer1, ECmIPNameServer1 },
+        { ETUNDriverIpNameServer2, ECmIPNameServer2 },
+        { ETUNDriverIp6DNSAddrFromServer, ECmIP6DNSAddrFromServer },
+        { ETUNDriverIp6NameServer1, ECmIP6NameServer1 },
+        { ETUNDriverIp6NameServer2, ECmIP6NameServer2 },
+        { ETUNDriverIpAddrLeaseValidFrom, ECmIPAddrLeaseValidFrom },
+        { ETUNDriverIpAddrLeaseValidTo, ECmIPAddrLeaseValidTo },
+        { ETUNDriverConfigDaemonManagerName, ECmConfigDaemonManagerName },
+        { ETUNDriverConfigDaemonName, ECmConfigDaemonName },
+        { 0, 0 }
+    };
+
+// --------------------------------------------------------------------------
+// CCmPluginTUNDriver::NewL()
+// --------------------------------------------------------------------------
+//
+CCmPluginTUNDriver* CCmPluginTUNDriver::NewL( TCmPluginInitParam* aInitParam )
+    {
+    CCmPluginTUNDriver* self = new( ELeave ) CCmPluginTUNDriver( aInitParam );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// --------------------------------------------------------------------------
+// CCmPluginTUNDriver::~CCmPluginTUNDriver()
+// --------------------------------------------------------------------------
+//
+CCmPluginTUNDriver::~CCmPluginTUNDriver()
+    {
+    AdditionalReset();
+    }
+
+// --------------------------------------------------------------------------
+// CCmPluginTUNDriver::CreateInstanceL
+// --------------------------------------------------------------------------
+//
+CCmPluginBaseEng* CCmPluginTUNDriver::CreateInstanceL( TCmPluginInitParam& aInitParam ) const
+    {
+    CCmPluginTUNDriver* self = new( ELeave ) CCmPluginTUNDriver( &aInitParam );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+    
+// --------------------------------------------------------------------------
+// CCmPluginTUNDriver::CCmPluginTUNDriver()
+// --------------------------------------------------------------------------
+//
+CCmPluginTUNDriver::CCmPluginTUNDriver( TCmPluginInitParam* aInitParam )
+    : CCmPluginLanBase( aInitParam )
+    {
+    CLOG_CREATE;
+    iBearerType = KPluginTUNDriverBearerTypeUid;
+    }
+
+// --------------------------------------------------------------------------
+// CCmPluginTUNDriver::ConstructL()
+// --------------------------------------------------------------------------
+//
+void CCmPluginTUNDriver::ConstructL()
+    {
+    CCmPluginLanBase::ConstructL();
+    iBearerRecName = KCDTypeNameVirtualBearer;
+   
+    AddConverstionTableL( (CCDRecordBase**)&iServiceRecord, NULL, STUNDriverConvTbl );
+    AddCommonConversionTableL( STUNDriverCommonConvTbl );
+    }
+
+// --------------------------------------------------------------------------
+// CCmPluginTUNDriver::GetIntAttributeL()
+// --------------------------------------------------------------------------
+//
+TUint32 CCmPluginTUNDriver::GetIntAttributeL( const TUint32 aAttribute ) const
+    {
+    LOGGER_ENTERFN( "CCmPluginTUNDriver::GetIntAttributeL" );
+
+    TUint32 retVal( 0 );
+
+    switch( aAttribute )
+        {
+        case ECmBearerIcon:
+            {
+            MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
+            TAknsItemID id;      
+            TParse mbmFile;
+            User::LeaveIfError( mbmFile.Set( KPluginTUNDriverFileIcons, 
+                                             &KDC_BITMAP_DIR, NULL ) );
+
+            retVal = (TUint32)AknsUtils::CreateGulIconL( 
+                                    skinInstance, 
+                                    id,
+                                    mbmFile.FullName(), 
+                                    EMbmCmpluginvpnQgn_prop_vpn_access_point, 
+                                    EMbmCmpluginvpnQgn_prop_vpn_access_point_mask );
+            }
+            break;             
+        case ECmCommsDBBearerType:
+            {
+            retVal = KCommDbBearerLAN;
+            }
+            break;
+        case ECmDefaultUiPriority:
+        case ECmDefaultPriority:
+            {
+            retVal = aAttribute == ECmDefaultPriority ?
+                        GlobalBearerPriority( TPtrC(KCDTypeNameLANService) ) :
+                        GlobalUiBearerPriority( TPtrC(KCDTypeNameLANService) );
+
+            if ( retVal == KDataMobilitySelectionPolicyPriorityWildCard )
+                {
+                retVal = KDefaultPriorityTUNDriver;
+                }
+            }
+            break;             
+        default:
+            {
+            retVal = CCmPluginBaseEng::GetIntAttributeL( aAttribute );
+            }
+        }
+
+    return retVal;
+    }
+
+// --------------------------------------------------------------------------
+// CCmPluginTUNDriver::CanHandleIapIdL()
+// --------------------------------------------------------------------------
+//
+TBool CCmPluginTUNDriver::CanHandleIapIdL( TUint32 aIapId ) const
+    {
+    LOGGER_ENTERFN( "CCmPluginTUNDriver::CanHandleIapIdL1" );
+    TBool retVal( EFalse );
+
+    CCDIAPRecord *iapRecord = static_cast<CCDIAPRecord *>
+                            (CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
+
+    CleanupStack::PushL( iapRecord );
+    iapRecord->SetRecordId( aIapId );
+
+    TRAPD( err, iapRecord->LoadL( Session() ));
+
+    if( !err )
+        {
+        CanHandleIapIdL( iapRecord );
+        }
+
+    CleanupStack::PopAndDestroy( iapRecord );
+    return retVal;
+    }
+
+// --------------------------------------------------------------------------
+// CCmPluginTUNDriver::CanHandleIapIdL()
+// --------------------------------------------------------------------------
+//
+TBool CCmPluginTUNDriver::CanHandleIapIdL( CCDIAPRecord *aIapRecord ) const
+    {
+    LOGGER_ENTERFN( "CCmPluginTUNDriver::CanHandleIapIdL" );
+
+    TBool retVal( EFalse );
+
+    if( TPtrC( aIapRecord->iServiceType ) == TPtrC(KCDTypeNameLANService) &&
+        TPtrC( aIapRecord->iBearerType ) == TPtrC(KCDTypeNameVirtualBearer) )
+        {
+        CMDBRecordSet<CCDVirtualBearerRecord>* bearersRS = 
+            new ( ELeave ) CMDBRecordSet<CCDVirtualBearerRecord>(KCDTIdVirtualBearerRecord);
+        CleanupStack::PushL( bearersRS );
+        CCDVirtualBearerRecord* bearerRecord =
+            static_cast<CCDVirtualBearerRecord *>( CCDRecordBase::RecordFactoryL( KCDTIdVirtualBearerRecord ) );
+        CleanupStack::PushL( bearerRecord );
+
+        // Find entries used "tundriveragt.agt" as agent from Table VirtualBearer
+        bearerRecord->iBearerAgent.SetL( KTUNDriverTunnelAgent );
+        bearerRecord->iVirtualBearerNifName.SetL( KTUNDriverInterfaceName );
+        bearersRS->iRecords.AppendL( bearerRecord );
+
+        CleanupStack::Pop( bearerRecord );
+        bearerRecord = NULL;
+        if ( bearersRS->FindL( Session() ) )
+            {
+            TUint32 recordId = (*bearersRS)[0]->RecordId();
+            TPtrC bearerName( (*bearersRS)[0]->iRecordName.GetL() );
+            TPtrC bearerAgent( (*bearersRS)[0]->iBearerAgent.GetL() );
+            TPtrC bearerInterface( (*bearersRS)[0]->iVirtualBearerNifName.GetL() );
+
+            // Further comparing record ID referred to by this VPN IAP with entry ID in table VirtualBearer
+            // And also comparing bear name with our expected one "vpnbearer"
+            if ( bearerAgent == TPtrC( KCDAgentNameTUNDriver ) &&
+                 bearerInterface == TPtrC( KCDInterfaceNameTUNDriver ) )
+                {
+                retVal = ETrue;
+                }
+            }
+
+        CleanupStack::PopAndDestroy( bearersRS );
+        }
+    return retVal;
+    }
+
+// --------------------------------------------------------------------------
+// CCmPluginTUNDriver::RunSettingsL()
+// --------------------------------------------------------------------------
+//        
+TInt CCmPluginTUNDriver::RunSettingsL()
+    {
+    LOGGER_ENTERFN( "CCmPluginTUNDriver::RunSettingsL" );
+    User::Leave( KErrNotSupported );
+    return KErrNotSupported;
+    }
+
+// --------------------------------------------------------------------------
+// CCmPluginTUNDriver::LoadServiceSettingL()
+// --------------------------------------------------------------------------
+//        
+void CCmPluginTUNDriver::LoadServiceSettingL()
+    {
+    LOGGER_ENTERFN( "CCmPluginTUNDriver::LoadServiceSettingL" );
+    
+    if( TPtrC(KCDTypeNameLANService) == iIapRecord->iServiceType )
+        {
+        iServiceRecord = static_cast<CCDLANServiceRecord *>
+                    ( CCDRecordBase::RecordFactoryL( KCDTIdLANServiceRecord ) );
+        }
+    else
+        {
+        User::Leave( KErrNotSupported );
+        }
+
+    CCmPluginBaseEng::LoadServiceSettingL();
+    }
+
+// --------------------------------------------------------------------------
+// CCmPluginTUNDriver::InitializeWithUiL()
+// --------------------------------------------------------------------------
+//   
+TBool CCmPluginTUNDriver::InitializeWithUiL( TBool /*aManuallyConfigure*/ )
+    {
+    User::Leave( KErrNotSupported );
+    return ETrue;
+    }
+
+// --------------------------------------------------------------------------
+// CCmPluginTUNDriver::ServiceRecord()
+// --------------------------------------------------------------------------
+//  
+CCDLANServiceRecord& CCmPluginTUNDriver::ServiceRecord() const
+    {
+    LOGGER_ENTERFN( "CCmPluginTUNDriver::ServiceRecord" );
+    return *static_cast<CCDLANServiceRecord*>( iServiceRecord );
+    }
+
+// --------------------------------------------------------------------------
+// CCmPluginTUNDriver::CreateNewServiceRecordL()
+// --------------------------------------------------------------------------
+//        
+void CCmPluginTUNDriver::CreateNewServiceRecordL()
+    {
+    LOGGER_ENTERFN( "CCmPluginTUNDriver::CreateNewServiceRecordL" );
+
+    delete iServiceRecord; 
+    iServiceRecord = NULL;
+
+    iServiceRecord = static_cast<CCDServiceRecordBase *>
+                (CCDRecordBase::RecordFactoryL( KCDTIdLANServiceRecord ));
+
+    // I do not think that we have to use the default record,
+    // but for compatibility with ApEngine, we write all fields 
+    CCDLANServiceRecord* record = 
+                            static_cast<CCDLANServiceRecord *>( iServiceRecord );
+
+    if ( FeatureSupported( KFeatureIdIPv6 ) )
+        {
+        record->iIfNetworks.SetL( KDefIspIfNetworksIPv4IPv6LAN );
+        }
+    else
+        {
+        record->iIfNetworks.SetL( KDefIspIfNetworksIPv4 );
+        }
+    record->iIpGateway.SetL( KUnspecifiedIPv4 );        
+    record->iIpAddrFromServer.SetL( KDefIpAddrFromServer );
+
+    record->iIpAddr.SetL( KUnspecifiedIPv4 );
+
+    record->iIpDnsAddrFromServer.SetL( KDefIpDnsAddrFromServer );
+
+    record->iIpNameServer1.SetL( KUnspecifiedIPv4 );
+    record->iIpNameServer2.SetL( KUnspecifiedIPv4 );
+    record->iIp6DnsAddrFromServer.SetL( KDefIp6DnsAddrFromServer );
+    record->iIp6NameServer1.SetL( KDynamicIpv6Address );
+    record->iIp6NameServer2.SetL( KDynamicIpv6Address );
+
+    if ( KDefIpAddrFromServer )
+        {
+        record->iConfigDaemonManagerName.SetL( KDaemonManagerName );
+        record->iConfigDaemonName.SetL( KConfigDaemonName );
+        }
+    else
+        {
+        record->iConfigDaemonManagerName.SetL( KEmpty );
+        record->iConfigDaemonName.SetL( KEmpty );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CCmPluginTUNDriver::ServiceRecordIdLC
+// ---------------------------------------------------------------------------
+//
+void CCmPluginTUNDriver::ServiceRecordIdLC( HBufC* &aName, TUint32& aRecordId )
+    {
+    LOGGER_ENTERFN( "CCmPluginTUNDriver::ServiceRecordIdLC" );
+
+    aName = TPtrC( KCDTypeNameLANService ).AllocLC();    
+    aRecordId = iServiceRecord->RecordId();
+    }
+
+// --------------------------------------------------------------------------
+// CCmPluginTUNDriver::BearerRecordIdLC()
+// --------------------------------------------------------------------------
+//      
+void CCmPluginTUNDriver::BearerRecordIdLC( HBufC* &aBearerName, TUint32& aRecordId )
+    {
+    LOGGER_ENTERFN( "CCmPluginTUNDriver::BearerRecordIdLC" );
+
+    CMDBRecordSet<CCDVirtualBearerRecord>* bearersRS = 
+                  new(ELeave) CMDBRecordSet<CCDVirtualBearerRecord>
+                                                       (KCDTIdVirtualBearerRecord);
+    CleanupStack::PushL( bearersRS );
+
+    CCDVirtualBearerRecord* tmprec = static_cast<CCDVirtualBearerRecord*>
+                        (CCDRecordBase::RecordFactoryL( KCDTIdVirtualBearerRecord ));
+    CleanupStack::PushL( tmprec );
+    tmprec->iBearerAgent.SetL( KTUNDriverTunnelAgent );
+    bearersRS->iRecords.AppendL( tmprec );
+
+    CleanupStack::Pop( tmprec );
+    tmprec = NULL;
+
+    if ( !bearersRS->FindL( Session() ) )
+        // No bearer record found -> create a default one.
+        {
+        tmprec = static_cast<CCDVirtualBearerRecord *>
+                    (CCDRecordBase::RecordFactoryL(KCDTIdVirtualBearerRecord));
+        CleanupStack::PushL(tmprec);
+
+        tmprec->iRecordName.SetL( KTUNDriverBearerName );
+        tmprec->iBearerAgent.SetL( KTUNDriverTunnelAgent );
+        tmprec->iVirtualBearerNifName.SetL(KTUNDriverInterfaceName);
+        tmprec->iLastSocketActivityTimeout = (TUint32)KLanLastSocketActivityTimeout;
+        tmprec->iLastSessionClosedTimeout = (TUint32) KLanLastSocketClosedTimeout;
+        tmprec->iLastSocketClosedTimeout = (TUint32)KLanLastSocketActivityTimeout;
+        
+        tmprec->SetRecordId( KCDNewRecordRequest );
+        tmprec->StoreL( Session() );
+        
+        aRecordId = tmprec->RecordId();
+
+        CleanupStack::PopAndDestroy(tmprec);
+        }
+    else
+        {
+        aRecordId = (*bearersRS)[0]->RecordId();
+        }
+
+    CleanupStack::PopAndDestroy( bearersRS );
+
+    aBearerName = TPtrC( KCDTypeNameVirtualBearer ).AllocLC();
+    }
+
+// --------------------------------------------------------------------------
+// CCmPluginTUNDriver::PrepareToUpdateRecordsL()
+// --------------------------------------------------------------------------
+//        
+void CCmPluginTUNDriver::PrepareToUpdateRecordsL()
+    {
+    LOGGER_ENTERFN( "CCmPluginTUNDriver::PrepareToUpdateRecordsL" );
+    CheckDNSServerAddressL( ETrue, 
+                            ServiceRecord().iIp6NameServer1,
+                            ServiceRecord().iIp6NameServer2,
+                            ServiceRecord().iIp6DnsAddrFromServer );
+                            
+    CheckDNSServerAddressL( EFalse,
+                            ServiceRecord().iIpNameServer1,
+                            ServiceRecord().iIpNameServer2,
+                            ServiceRecord().iIpDnsAddrFromServer );
+    }
+
+// --------------------------------------------------------------------------
+// CCmPluginTUNDriver::AdditionalReset()
+// --------------------------------------------------------------------------
+//        
+void CCmPluginTUNDriver::AdditionalReset()
+    {
+
+    }
+
+// eof
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cmmanager/cmmgr/Rom/cmplugintundriver.iby	Tue Sep 14 22:06:05 2010 +0300
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 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"
+* 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:
+*
+*/
+
+#ifndef __CMPLUGINTUNDRIVER_IBY__
+#define __CMPLUGINTUNDRIVER_IBY__
+
+
+ECOM_PLUGIN(cmplugintundriver.dll,20027F3E.rsc)
+SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,cmplugintundriver)
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cmmanager/cmmgr/Rom/cmplugintundriverresources.iby	Tue Sep 14 22:06:05 2010 +0300
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 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"
+* 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:
+*
+*/
+
+#ifndef __CMPLUGINTUNDRIVER_RESOURCES_IBY__
+#define __CMPLUGINTUNDRIVER_RESOURCES_IBY__
+
+
+data = DATAZ_\RESOURCE_FILES_DIR\cmplugintundriverui.rsc     RESOURCE_FILES_DIR\cmplugintundriverui.rsc
+
+#
+#endif
\ No newline at end of file
--- a/cmmanager/cmmgr/group/bld.inf	Wed Sep 01 12:23:51 2010 +0100
+++ b/cmmanager/cmmgr/group/bld.inf	Tue Sep 14 22:06:05 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006-2008 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"
@@ -35,6 +35,9 @@
 ../Rom/cmpluginvpn.iby				CORE_MW_LAYER_IBY_EXPORT_PATH(cmpluginvpn.iby)
 ../Rom/cmpluginvpnresources.iby			LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(cmpluginvpnresources.iby)
 
+../Rom/cmplugintundriver.iby				CORE_MW_LAYER_IBY_EXPORT_PATH(cmplugintundriver.iby)
+../Rom/cmplugintundriverresources.iby			LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(cmplugintundriverresources.iby)
+
 ../Rom/cmpluginwlan.iby				CORE_MW_LAYER_IBY_EXPORT_PATH(cmpluginwlan.iby)
 ../Rom/cmpluginwlanresources.iby		LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(cmpluginwlanresources.iby)
 
--- a/connectionmonitoring/connmon/connectionmonitor/src/connmoncommsdatcache.cpp	Wed Sep 01 12:23:51 2010 +0100
+++ b/connectionmonitoring/connmon/connectionmonitor/src/connmoncommsdatcache.cpp	Tue Sep 14 22:06:05 2010 +0300
@@ -524,7 +524,9 @@
     TInt err( KErrNone );
 
     TBool availabilityEventsEnabled( EFalse );
-    if ( ( aBearerId == EBearerIdAll ) || ( aBearerId == EBearerIdVirtualVPN ) )
+    if ( ( aBearerId == EBearerIdAll ) || 
+         ( aBearerId == EBearerIdVirtualVPN ) ||
+         ( aBearerId == EBearerIdWLAN ) )
         {
         // If WLAN background scanning is on, and client is asking IAP
         // availability for all- or virtual IAPs, send IAP availability changed
Binary file data/cccccc00_emulator.cre has changed
--- a/inc/meshpreface1.cfg	Wed Sep 01 12:23:51 2010 +0100
+++ b/inc/meshpreface1.cfg	Tue Sep 14 22:06:05 2010 +0300
@@ -272,6 +272,13 @@
 	FIELD_COUNT=2
 END_ADD
 
+ADD_SECTION
+# COMMDB_ID = 14
+	Name=tundrivermcpr
+	MCprUid=0x10281E05
+	FIELD_COUNT=2
+END_ADD
+
 ############################################################
 ## CprTable
 ## 
@@ -467,6 +474,13 @@
 	FIELD_COUNT=2
 END_ADD
 
+ADD_SECTION
+# COMMDB_ID = 12
+	Name=tundriverprotocol
+	ProtocolUid=0x10281C3C
+	FIELD_COUNT=2
+END_ADD
+
 ############################################################
 ## BearerTypeTable
 ## 
@@ -610,4 +624,14 @@
 	FIELD_COUNT=6
 END_ADD
 
+ADD_SECTION
+# COMMDB_ID = 13
+	Name=tundriver
+	Tier=Link.TierTable.271064565
+	MCpr=MCprTable.14
+	Cpr=CprTable.3
+	SCpr=SCprTable.3
+	Protocol=ProtocolTable.12
+	FIELD_COUNT=6
+END_ADD
 
--- a/ipcm_pub/connection_settings_api/group/bld.inf	Wed Sep 01 12:23:51 2010 +0100
+++ b/ipcm_pub/connection_settings_api/group/bld.inf	Tue Sep 14 22:06:05 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006 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"
@@ -12,7 +12,7 @@
 * Contributors:
 *
 * Description:  File that exports the files belonging to 
-:                Connection Settings API
+*               Connection Settings API
 *
 */
 
@@ -41,3 +41,4 @@
 ../inc/cmmanager.h     MW_LAYER_PUBLIC_EXPORT_PATH(cmmanager.h)
 ../inc/cmsettingsui.h     MW_LAYER_PUBLIC_EXPORT_PATH(cmsettingsui.h)
 ../inc/cmgenconnsettings.h     MW_LAYER_PUBLIC_EXPORT_PATH(cmgenconnsettings.h)
+../inc/cmplugintundriverdef.h     MW_LAYER_PUBLIC_EXPORT_PATH(cmplugintundriverdef.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ipcm_pub/connection_settings_api/inc/cmplugintundriverdef.h	Tue Sep 14 22:06:05 2010 +0300
@@ -0,0 +1,148 @@
+/*
+* Copyright (c) 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"
+* 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: Attributes for TUN Driver plug-in.
+*
+*/
+
+
+#ifndef CMPLUGINTUNDRIVER_DEF_H
+#define CMPLUGINTUNDRIVER_DEF_H
+
+#include <cmconnectionmethoddef.h>
+const TUint KPluginTUNDriverBearerTypeUid = 0x20027F3F;
+
+namespace CMManager
+    {
+    /** LAN specific connection method attributes */
+    enum TConnectionMethodTUNDriverSpecificAttributes
+        {
+		ETUNDriverSpecificAttributes = 20000,
+        
+        /**
+        * Comma separated list of network protocols, e.g. "PPP".
+        * ( String - default: None)
+        */
+        ETUNDriverIfNetworks = KLanBaseIfNetworks,
+        
+        /**
+        * IP net mask of interface.
+        * ( String - default: None)
+        */        
+        ETUNDriverIpNetMask,
+
+        /**
+        * IP address of gateway
+        * ( String - default: None)
+        */
+        ETUNDriverIpGateway,
+
+        /**
+        * Get IP addresses (for EPOC) from server?
+        * ( TBool - default: None)
+        */
+        ETUNDriverIpAddrFromServer,
+
+        /**
+        * IP address of EPOC.
+        * ( String - default: None)
+        */
+        ETUNDriverIpAddr,
+
+        /**
+        * Get DNS addresses from server?
+        * ( TBool - default: None)
+        */
+        ETUNDriverIpDNSAddrFromServer,
+
+        /**
+        * IP Address of primary name server.
+        * ( String - default: None)
+        */
+        ETUNDriverIpNameServer1,
+
+        /**
+        * IP Address of secondary name server.
+        * ( String - default: None)
+        */
+        ETUNDriverIpNameServer2,
+
+        /**
+        * Get IP6 DNS addresses from server?
+        * ( TBool - default: None)
+        */
+        ETUNDriverIp6DNSAddrFromServer,
+
+        /**
+        * IP6 Address of primary name server.
+        * ( String - default: None)
+        */
+        ETUNDriverIp6NameServer1,
+
+        /**
+        * IP6 Address of secondary name server.
+        * ( String - default: None)
+        */
+        ETUNDriverIp6NameServer2,
+
+        /**
+        * IP address valid from this time, used to store 
+        * dynamically assigned address lease info.
+        * ( String - default: None)
+        */
+        ETUNDriverIpAddrLeaseValidFrom,
+
+        /**
+        * IP address valid for use until this time, used to store .
+        * dynamically assigned address lease info.
+        * ( String - default: None)
+        */
+        ETUNDriverIpAddrLeaseValidTo,
+
+        /**
+        * Name of the ECOM configuration daemon manager component. 
+        * This component interfaces with the server identified in 
+        * ISP_CONFIG_DAEMON_NAME. If specified, ISP_CONFIG_DAEMON_NAME 
+        * should also be specified. 
+        * ( String - default: None)
+        */
+        ETUNDriverConfigDaemonManagerName,
+
+        /**
+        * Name of the configuration daemon server. 
+        * This server is used to provide further configuration for 
+        * a connection, e.g. dynamic IP address assignment. 
+        * If specified, ISP_CONFIG_DAEMON_MANAGER_NAME should also 
+        * be specified.
+        * ( String - default: None)
+        */
+        ETUNDriverConfigDaemonName,
+
+        /**
+        * Name of the TUN Driver Service Extension table.
+        * ( String - default: None)
+        */
+        ETUNDriverServiceExtensionTableName,
+
+        /**
+        * The record ID of the linked TUN Driver Service Extension record in the
+        * TUN Driver Service Extension table.
+        * ( TUint32 - default: None)
+        */
+        ETUNDriverServiceExtensionTableRecordId,
+
+        ETUNDriverRangeMax = KLanBaseRangeMax
+        };
+    } // namespace CMManager
+
+#endif // CMPLUGINTUNDRIVER_DEF_H