realtimenetprots/sipfw/SIP/SIPSec/IpSecPlugin/src/CStateClearing.cpp
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Name          : CStateClearing.cpp
       
    15 // Part of       : SIPSec, IpSec Plugin
       
    16 // Version       : SIP/4.0 
       
    17 //
       
    18 
       
    19 
       
    20 
       
    21 #include "CSipSecAgreeRecord.h"
       
    22 #include "MIpSecAgreeContextParams.h"
       
    23 #include "CStateClearing.h"	
       
    24 #include "MIpSecMechanismParams.h"
       
    25 
       
    26 // ----------------------------------------------------------------------------
       
    27 // CClearing::CClearing
       
    28 // ----------------------------------------------------------------------------
       
    29 //
       
    30 CClearing::CClearing() 
       
    31     {
       
    32     }
       
    33 
       
    34 // ----------------------------------------------------------------------------
       
    35 // CClearing::State
       
    36 // ----------------------------------------------------------------------------
       
    37 //
       
    38 CState::TSecAgreeRecordState CClearing::State()
       
    39 	{
       
    40 	return EClearing;
       
    41 	}
       
    42 
       
    43 // ----------------------------------------------------------------------------
       
    44 // CClearing::RegisterL
       
    45 // ----------------------------------------------------------------------------
       
    46 //			
       
    47 void CClearing::RegisterL(  
       
    48 	CSipSecAgreeRecord& aRec,
       
    49 	CSIPRequest& aRequest,
       
    50 	TSIPTransportParams& aTransportParams,
       
    51 	const TDesC8& /*aOutboundProxy*/ )
       
    52 	{
       
    53     // If new registration attempt occurs very fast, SAs deletion might be
       
    54     // still ongoing, treat the register as a fresh registration
       
    55     if ( aRec.iParams.HasOnlyOneRecord() )
       
    56         {
       
    57         aRec.iParams.MechParams().ProcessInitialReqisterL( aTransportParams, 
       
    58                                                            aRequest );
       
    59         }
       
    60 	}
       
    61 	
       
    62 // ----------------------------------------------------------------------------
       
    63 // CClearing::SaDeleted
       
    64 // ----------------------------------------------------------------------------
       
    65 //	
       
    66 void CClearing::SaDeleted( CSipSecAgreeRecord& aRec )
       
    67 	{
       
    68     CompleteIfReady( aRec );
       
    69 	}
       
    70 	
       
    71 // ----------------------------------------------------------------------------
       
    72 // CClearing::PolicyUnloaded
       
    73 // ----------------------------------------------------------------------------
       
    74 //      
       
    75 void CClearing::PolicyUnloaded( CSipSecAgreeRecord& aRec )
       
    76     {
       
    77     CompleteIfReady( aRec );
       
    78     }
       
    79 
       
    80 // ----------------------------------------------------------------------------
       
    81 // CClearing::CompleteIfReady
       
    82 // ----------------------------------------------------------------------------
       
    83 //    
       
    84 void CClearing::CompleteIfReady( CSipSecAgreeRecord& aRec )
       
    85     {
       
    86     if ( aRec.UnloadingAndDeletionDone() )
       
    87 	    {
       
    88 	    aRec.StopTimer();
       
    89 	    // Leads to deletion of aRec and possibly to whole agree context
       
    90 	    aRec.iParams.SaCleared( &aRec );
       
    91 	    }
       
    92     }
       
    93 	
       
    94 // End of File