natfw/natfwstunserver/inc/natfwstunsrvclientsession.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2007-2008 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:    Provides client interface of the NAT FW STUN server
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef NATFWSTUNSRVCLIENTSESSION_H
       
    22 #define NATFWSTUNSRVCLIENTSESSION_H
       
    23 
       
    24 #include <e32base.h>
       
    25 #include "natfwconnectivityapidefs.h"
       
    26 
       
    27 class CNATFWSTUNSrvImpl;
       
    28 class MNATFWStunSrvObserver;
       
    29 class CNATFWCredentials;
       
    30 class MNcmConnectionMultiplexer;
       
    31 class TInetAddr;
       
    32 
       
    33 /**
       
    34  * Interface of the NATFW STUN server, which client uses to listen to 
       
    35  * incoming STUN requests. Also Turn spesific data indications are decoded.
       
    36  *
       
    37  *  @lib stunserver.lib
       
    38  *  @since S60 v3.2
       
    39  */
       
    40 NONSHARABLE_CLASS( CNATFWSTUNSrvClientSession ): public CBase
       
    41     {
       
    42 
       
    43 public:
       
    44     
       
    45     /**
       
    46      * Two-phased constructor.
       
    47      * @param aObserver    A callback object to receive and handle
       
    48      *                     event notifications from NAT FW STUN server.
       
    49      * @param aMultiplexer multiplexer.
       
    50      */
       
    51     IMPORT_C static CNATFWSTUNSrvClientSession* NewL( 
       
    52                                 MNATFWStunSrvObserver& aObserver,
       
    53                                 MNcmConnectionMultiplexer& aMultiplexer );
       
    54     /**
       
    55      * Destructor.
       
    56      */
       
    57     virtual ~CNATFWSTUNSrvClientSession();
       
    58 
       
    59     /**
       
    60      * Starts listening to incoming STUN requests.
       
    61      * Notifies the client of STUN requests that are valid.
       
    62      *  
       
    63      * @since S60 3.2
       
    64      * @param aIdentifications Authentication passwords
       
    65      * @return void
       
    66      */
       
    67     IMPORT_C void AddAuthenticationParamsL( 
       
    68         const RPointerArray<CNATFWCredentials>& aIdentifications );
       
    69      
       
    70     /**
       
    71      * Stops listening to incoming STUN requests.
       
    72      *  
       
    73      * @since S60 3.2
       
    74      * @param aIdentifications Authentication passwords
       
    75      * @return void
       
    76      */
       
    77     IMPORT_C void RemoveAuthenticationParamsL( 
       
    78         const RPointerArray<CNATFWCredentials>& aIdentifications );
       
    79         
       
    80     /**
       
    81      * Sets role for an agent. 
       
    82      *  
       
    83      * @since S60 3.2
       
    84      * @param aRole       Either controlling or controlled.  
       
    85      * @param aTieBreaker Value for determining which agent will change
       
    86      *                    Role if role conflict is present
       
    87      * @return void
       
    88      */        
       
    89     IMPORT_C void SetRoleL( TNATFWIceRole aRole, 
       
    90         TUint64 aTieBreaker );         
       
    91                        
       
    92 
       
    93 private:
       
    94 
       
    95     CNATFWSTUNSrvClientSession();
       
    96     
       
    97     void ConstructL( MNATFWStunSrvObserver& aObserver,
       
    98                      MNcmConnectionMultiplexer& aMultiplexer );
       
    99     
       
   100 private:
       
   101 
       
   102     /*
       
   103      * NAT FW STUN server implementation
       
   104      * Own.
       
   105      */ 
       
   106     CNATFWSTUNSrvImpl* iImplementation;
       
   107     };
       
   108 
       
   109 #endif // NATFWSTUNSRVCLIENTSESSION_H