natfw/natfwstunturnclient/inc/cstunbindinggetaddress.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2005-2007 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:    
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef C_CSTUNBINDINGGETADDRESS_H
       
    22 #define C_CSTUNBINDINGGETADDRESS_H
       
    23 
       
    24 // INCLUDES
       
    25 #include "cstunbindingstate.h"
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 
       
    29 // CLASS DECLARATION
       
    30 
       
    31 /**
       
    32  *  In this state, the binding the transaction to complete and return a
       
    33  *  public address.
       
    34  *
       
    35  *  @lib ?library
       
    36  *  @since S60 ?S60_version *** for example, S60 v3.0
       
    37  */
       
    38 class CSTUNBindingGetAddress : public CSTUNBindingState
       
    39     {
       
    40     public: // Constructors and destructor
       
    41 
       
    42         /**
       
    43         * Constructor        
       
    44         */
       
    45         CSTUNBindingGetAddress();
       
    46 
       
    47           /**
       
    48         * Destructor
       
    49         */
       
    50         virtual ~CSTUNBindingGetAddress();
       
    51 
       
    52     public: // From CSTUNBindingState
       
    53 
       
    54         void PublicAddressReceivedL( CBindingImplementation& aContext,
       
    55                                      const TInetAddr& aPublicAddress ) const;
       
    56         
       
    57         // Overloaded for stun relay usage
       
    58         void PublicAddressReceivedL( CBindingImplementation& aContext,
       
    59                                      const TInetAddr& aReflexiveAddr,
       
    60                                      const TInetAddr& aRelayAddr ) const;
       
    61                                        
       
    62 
       
    63         void TransactionError( CBindingImplementation& aContext,
       
    64                                TInt aError );
       
    65 
       
    66         void SendRequestL( CBindingImplementation& aContext ) const;
       
    67         
       
    68 
       
    69     public: // New functions
       
    70     
       
    71         /**
       
    72         * Set the neighbour states.
       
    73         * @param aGetSharedSecret GetSharedSecret state
       
    74         * @param aWaitToRetry WaitToRetry state
       
    75         * @param aActive Active state
       
    76         */
       
    77         void SetNeighbourStates( CSTUNBindingState& aGetSharedSecret,
       
    78                                  CSTUNBindingState& aWaitToRetry,
       
    79                                  CSTUNBindingState& aActive );
       
    80 
       
    81     private:
       
    82 
       
    83         CSTUNBindingGetAddress( const CSTUNBindingGetAddress& aGetAddress );
       
    84 
       
    85     private: // Data
       
    86 
       
    87         //Next possible states, not owned
       
    88         CSTUNBindingState* iActive;
       
    89         CSTUNBindingState* iWaitToRetry;
       
    90         CSTUNBindingState* iGetSharedSecret;
       
    91         
       
    92         /**
       
    93          * Error buffer to keep record of occurred binding errors.
       
    94          */
       
    95         RArray<TInt> iErrorBuffer;
       
    96     };
       
    97 
       
    98 #endif // C_CSTUNBINDINGGETADDRESS_H