vpnengine/ikev2lib/inc/ikev2retransmittimer.h
changeset 0 33413c0669b9
equal deleted inserted replaced
-1:000000000000 0:33413c0669b9
       
     1 /*
       
     2 * Copyright (c) 2003-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:  Timer to trigger IKE request resend, if do not obtain a reply
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef C_IKEV2RETRANSMITTIMER_H
       
    19 #define C_IKEV2RETRANSMITTIMER_H
       
    20 
       
    21 #include <e32base.h>
       
    22 
       
    23 /**
       
    24  *  IKEv2 retransmit timer callback interface.
       
    25  *  Callback interface which is used by CIkev2RetransmitTimer object to request
       
    26  *  IKE request resend.
       
    27  *  
       
    28  *  @lib internal (ikev2lib.lib)
       
    29  */
       
    30 NONSHARABLE_CLASS(MIkev2RetransmitTimerCallback)
       
    31     {
       
    32 public:        
       
    33     /**
       
    34      * Request IKE request resend.
       
    35      */
       
    36     virtual void RetransmitRequest() = 0;
       
    37     };
       
    38 
       
    39 /**
       
    40  *  IKEv2 retransmit timer.
       
    41  *  Triggers IKE request retransmit after timeout.
       
    42  *  
       
    43  *  @lib internal (ikev2lib.lib)
       
    44  */
       
    45 NONSHARABLE_CLASS(CIkev2RetransmitTimer) : public CTimer
       
    46 {
       
    47 public:
       
    48     static CIkev2RetransmitTimer* NewL( MIkev2RetransmitTimerCallback& aCallback );
       
    49 	~CIkev2RetransmitTimer();
       
    50     
       
    51 	/**
       
    52 	 * Issues a reques to the timer.
       
    53 	 * The actual time out value is calculated:
       
    54      * timeout = aSendAttempt * 1 second;
       
    55 	 * 
       
    56 	 * @param aSendAttempt the current send attempt count
       
    57 	 */
       
    58 	void IssueRequest( TUint16 aSendAttempt );
       
    59 	
       
    60 protected:
       
    61     void RunL();
       
    62        
       
    63 private:
       
    64     CIkev2RetransmitTimer( MIkev2RetransmitTimerCallback& aCallback );
       
    65   
       
    66 private: // data    
       
    67 	MIkev2RetransmitTimerCallback& iCallback;	
       
    68 };
       
    69 #endif // C_IKEV2RETRANSMITTIMER_H