vpnengine/ikesocket/inc/ikeconnectioninterface.h
changeset 0 33413c0669b9
equal deleted inserted replaced
-1:000000000000 0:33413c0669b9
       
     1 /*
       
     2 * Copyright (c) 2008-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:  IKE socket connection interface
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_IKECONNECTIONINTERFACE_H
       
    20 #define C_IKECONNECTIONINTERFACE_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <in_sock.h>
       
    24 #include "ikesocketdefs.h"
       
    25 
       
    26 using namespace IkeSocket;
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class MIkeDebug;
       
    30 class MIkeDataInterface;
       
    31 class RSocketServer;
       
    32 
       
    33 /**
       
    34  *  IKE socket connection interface.
       
    35  *
       
    36  *  This interface defines functionality for managing VPN AP's real network
       
    37  *  connection.
       
    38  * 
       
    39  *  Data interface (MIkeDataInterface) needs to be opened via this class. Data
       
    40  *  interface is closed automatically, when instance of connection interface
       
    41  *  (this interface) is deleted.
       
    42  *
       
    43  *  @lib ikesocket.lib
       
    44  */
       
    45 
       
    46 class CIkeConnectionInterface : protected CActive
       
    47     {
       
    48 public:    
       
    49      /**
       
    50      * Two-phased constructor.
       
    51      * @param aDebug Debug trace interface
       
    52      */
       
    53     IMPORT_C static CIkeConnectionInterface* NewL( MIkeDebug& aDebug );
       
    54     
       
    55     /**
       
    56     * Destructor.
       
    57     */
       
    58     virtual ~CIkeConnectionInterface();    
       
    59     
       
    60     /**
       
    61      * Opens data interface.
       
    62      *
       
    63      * @param aIkeMajorVersion IKE major version
       
    64      * @param aIpVersion IP protocol version
       
    65      * @return Data interface
       
    66      */
       
    67     virtual MIkeDataInterface& OpenDataInterfaceL( const TIkeMajorVersion aIkeMajorVersion,
       
    68                                                    const TIpVersion aIpVersion ) = 0;
       
    69     
       
    70     /**
       
    71      * Establishes connection for specified SNAP (destination) or IAP.
       
    72      *
       
    73      * @param aIapId IAP id
       
    74      * @param aSnapId SNAP id
       
    75      * @param aStatus Completion status (returned)
       
    76      * @param aForcedRoaming Indicates whether forced roaming is enabled or
       
    77      *                       disabled for SNAP
       
    78      */
       
    79     virtual void StartConnection( const TUint32 aIapId,
       
    80                                   const TUint32 aSnapId,
       
    81                                   TRequestStatus& aStatus,
       
    82                                   const TBool aForcedRoaming = EFalse ) = 0;
       
    83     
       
    84     /**
       
    85      * Cancels connection establishment.
       
    86      *
       
    87      */
       
    88     virtual void CancelStartConnection() = 0;
       
    89         
       
    90     /**
       
    91      * Closes the connection.
       
    92      *
       
    93      */
       
    94     virtual void StopConnection() = 0;
       
    95     
       
    96     /**
       
    97      * Resolves an IP address from FQDN address.
       
    98      *
       
    99      * @param aFQDN Fully Qualified Domain Name
       
   100      * @param aNameEntry Result of name resolution (returned)
       
   101      * @param aStatus Completion status (returned)
       
   102      */
       
   103     virtual void ResolveFQDNAddress( const TDesC& aFQDN,
       
   104                                      TNameEntry& aNameEntry,
       
   105                                      TRequestStatus& aStatus ) = 0;
       
   106     
       
   107     /**
       
   108      * Cancels FQDN address resolving.
       
   109      *
       
   110      */
       
   111     virtual void CancelResolveFQDNAddress() = 0;
       
   112     
       
   113     /**
       
   114      * Starts listening disconnect notification.
       
   115      *
       
   116      * @param aStatus Disconnection status (returned)
       
   117      */
       
   118     virtual void NotifyDisconnect( TRequestStatus& aStatus ) = 0;
       
   119     
       
   120     /**
       
   121      * Cancels notifying of disconnect indication.
       
   122      *
       
   123      */
       
   124     virtual void CancelNotifyDisconnect() = 0;
       
   125     
       
   126     /**
       
   127      * Returns IAP id.
       
   128      *
       
   129      * @return IAP id
       
   130      */
       
   131     virtual TUint32 IapId() const = 0;
       
   132     
       
   133     /**
       
   134      * Returns NET id.
       
   135      *
       
   136      * @return NET id
       
   137      */
       
   138     virtual TUint32 NetId() const = 0;
       
   139 
       
   140     /**
       
   141      * Returns SNAP id.
       
   142      *
       
   143      * @return SNAP id
       
   144      */
       
   145     virtual TUint32 SnapId() const = 0;
       
   146     
       
   147     /**
       
   148      * Gets local IP address of interface.
       
   149      *
       
   150      * @param aIpVersion IP version of local IP address
       
   151      * @param aLocalIp Local IP address (returned)
       
   152      * @return Error status. KErrNotFound if address is not found.
       
   153      */
       
   154     virtual TInt GetLocalAddress( const TIpVersion aIpVersion,
       
   155                                   TInetAddr& aLocalIp ) = 0;
       
   156     
       
   157 protected:
       
   158     
       
   159     CIkeConnectionInterface( TInt aPriority );
       
   160     
       
   161     };
       
   162 
       
   163 
       
   164 #endif // C_IKECONNECTIONINTERFACE_H