realtimenetprots/sipfw/SIP/SIPSec/IpSecPlugin/src/CStatePendingPolicy.cpp
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 // Copyright (c) 2005-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          : CStatePendingPolicy.cpp
       
    15 // Part of       : SIPSec, IpSec Plugin
       
    16 // Version       : SIP/4.0 
       
    17 //
       
    18 
       
    19 
       
    20 
       
    21 #include "sipresponse.h"
       
    22 #include "CSipSecAgreeRecord.h"
       
    23 #include "MIpSecAgreeContextParams.h"
       
    24 #include "CStatePendingPolicy.h"	
       
    25 
       
    26 // ----------------------------------------------------------------------------
       
    27 // CPendingPolicy::CPendingPolicy
       
    28 // ----------------------------------------------------------------------------
       
    29 //
       
    30 CPendingPolicy::CPendingPolicy() 
       
    31     {
       
    32     }
       
    33 
       
    34 // ----------------------------------------------------------------------------
       
    35 // CPendingPolicy::State
       
    36 // ----------------------------------------------------------------------------
       
    37 //
       
    38 CState::TSecAgreeRecordState CPendingPolicy::State()
       
    39 	{
       
    40 	return EPendingPolicy;
       
    41 	}
       
    42 
       
    43 // ----------------------------------------------------------------------------
       
    44 // CPendingPolicy::PolicyActivatedL
       
    45 // ----------------------------------------------------------------------------
       
    46 //	
       
    47 void CPendingPolicy::PolicyActivatedL( CSipSecAgreeRecord& aRec )
       
    48 	{
       
    49 	// Policy loaded and activated succesfully
       
    50 	aRec.NextState( ETemporal );
       
    51 	aRec.iParams.SAReady( ETrue );
       
    52 	}
       
    53 
       
    54 // ----------------------------------------------------------------------------
       
    55 // CPendingPolicy::TimerExpiredL
       
    56 // ----------------------------------------------------------------------------
       
    57 //		
       
    58 void CPendingPolicy::TimerExpiredL(  
       
    59 	CSipSecAgreeRecord& aRec,
       
    60 	TTimerId /* aTimerId */, 
       
    61 	TAny* /* aTimerParam */ )
       
    62 	{
       
    63 	// SAs were created successfully but policy not, inform the observer
       
    64 	// about unsuccess
       
    65 	aRec.iParams.SAReady( EFalse );
       
    66 	DeleteSasL( aRec );
       
    67 	}
       
    68 		
       
    69 // ----------------------------------------------------------------------------
       
    70 // CPendingPolicy::Resp4xxL
       
    71 // ----------------------------------------------------------------------------
       
    72 //	
       
    73 void CPendingPolicy::Resp4xxL(  
       
    74 	CSipSecAgreeRecord& aRec,
       
    75 	CSIPResponse& aResponse,
       
    76 	CSIPRequest& /* aRequest */ )
       
    77 	{
       
    78 	aRec.iParams.SAReady( EFalse );
       
    79 	ReInitializeL( aRec, aResponse, ETrue );
       
    80 	}
       
    81 
       
    82 // ----------------------------------------------------------------------------
       
    83 // CPendingPolicy::ClearSaL
       
    84 // ----------------------------------------------------------------------------
       
    85 //	
       
    86 void CPendingPolicy::ClearSaL( CSipSecAgreeRecord& aRec )
       
    87 	{
       
    88 	aRec.iParams.SAReady( EFalse );
       
    89 	aRec.StopTimer();
       
    90 	DoClearSaL( aRec );	
       
    91 	}
       
    92 
       
    93 // End of File