vpnengine/kmdserver/inc/iachangeobserver.h
changeset 0 33413c0669b9
equal deleted inserted replaced
-1:000000000000 0:33413c0669b9
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  active object, that monitors internal address change
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_IACHANGEOBSERVER_H
       
    20 #define C_IACHANGEOBSERVER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include "eventmediatorapi.h"
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class CInternalAddress;
       
    27 class MIkeDebug;
       
    28 class MIkePluginSessionIf;
       
    29 class TInetAddr;
       
    30 
       
    31 /**
       
    32  *  IA change observer.
       
    33  *  Active object that provides functionality for observing internal address
       
    34  *  change.
       
    35  *
       
    36  *  @lib internal (kmdserver.exe)
       
    37   */
       
    38 class CIaChangeObserver : public CActive
       
    39     {
       
    40 public:
       
    41     /**
       
    42      * Two-phased constructor.
       
    43      * @param aVpnIapId VPN IAP id
       
    44      * @param aDnsServerAddr DNS server address from IKE policy
       
    45      * @param aIkePluginSession IKE plugin session
       
    46      * @param aDebug Debug trace interface
       
    47      */
       
    48     static CIaChangeObserver* NewL( TUint32 aVpnIapId,
       
    49                                     const TInetAddr& aDnsServerAddr,
       
    50                                     MIkePluginSessionIf& aIkePluginSession,
       
    51                                     MIkeDebug& aDebug );
       
    52 
       
    53     /**
       
    54      * Destructor.
       
    55      */
       
    56     ~CIaChangeObserver();
       
    57 
       
    58     /**
       
    59      * Starts observing internal address change.
       
    60      */
       
    61     void StartObserving();
       
    62     
       
    63 private:
       
    64     
       
    65     CIaChangeObserver( TUint32 aVpnIapId,
       
    66                        const TInetAddr& aDnsServerAddr,
       
    67                        MIkePluginSessionIf& aIkePluginSession,
       
    68                        MIkeDebug& aDebug );
       
    69     
       
    70     void ConstructL();
       
    71 
       
    72 // from base class CActive
       
    73     
       
    74     /**
       
    75      * From CActive
       
    76      * Handles completion of asynchronous notification request.
       
    77      */    
       
    78     void RunL();
       
    79 
       
    80     /**
       
    81      * From CActive
       
    82      * Handles cancellation of asynchronous notification request.
       
    83      */    
       
    84     void DoCancel();
       
    85         
       
    86 private: // data
       
    87     
       
    88     /**
       
    89      * Event mediator.
       
    90      * Own.
       
    91      */
       
    92     REventMediator             iEventMediator;
       
    93 
       
    94     /**
       
    95      * VPN IAP Id.
       
    96      * Own.
       
    97      */            
       
    98     TUint32                    iVpnIapId;
       
    99     
       
   100     /**
       
   101      * DNS server address.
       
   102      * Own.
       
   103      */
       
   104     TInetAddr                   iDnsServerAddr;
       
   105 
       
   106     /**
       
   107      * Internal address.
       
   108      * Own.
       
   109      */
       
   110     TVPNAddress                iInternalAddress;
       
   111     
       
   112     /**
       
   113      * IKE plugin session.
       
   114      * Not own.
       
   115      */
       
   116     MIkePluginSessionIf&        iIkePluginSession;
       
   117     
       
   118     /**
       
   119      * Debug trace interface.
       
   120      * Not own.
       
   121      */
       
   122     MIkeDebug&                  iDebug;            
       
   123     };
       
   124 
       
   125 
       
   126 #endif // C_IACHANGEOBSERVER_H