multimediacommsengine/tsrc/testdriver/siptester/src/TCmdGetDomainParams.cpp
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2006 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:  Implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <centralrepository.h>
       
    20 #include <unsafprotocolscrkeys.h>
       
    21 #include "TCmdGetDomainParams.h"
       
    22 #include "TCmdSetUNSAFTimers.h"
       
    23 #include "SIPConstants.h"
       
    24 #include "CTcSIPContext.h"
       
    25 
       
    26 /**
       
    27  * INPUT:
       
    28  *   Headers:		-
       
    29  *   Parameters:	KParamDomainName
       
    30  *   IDs:			-
       
    31  *
       
    32  * OUTPUT:
       
    33  *   Parameters:	KParamUNSAFSharedSecretNotSupported,
       
    34  *					KParamUNSAFBindingRequestFailed
       
    35  *   IDs:			-
       
    36  *
       
    37  * If some parameter is not present in the repository, its value is returned as
       
    38  * KErrNotFound.
       
    39  *
       
    40  */
       
    41 void TCmdGetDomainParams::ExecuteL()
       
    42 	{
       
    43 	TPtrC8 proxy = ExtractTextL( KParamDomainName, ETrue );
       
    44 	
       
    45 	CRepository* repository = CRepository::NewLC( KCRUidUNSAFProtocols );
       
    46 	TUint32 key( 0 );
       
    47 	
       
    48 	TInt sharedSecretNotSupported( KErrNotFound );
       
    49 	TInt bindingRequestFailed( KErrNotFound );
       
    50 	
       
    51 	User::LeaveIfError( FindDomainKeyL( *repository, proxy, key ) );
       
    52 	
       
    53     Read( *repository,
       
    54     	  KUNSAFProtocolsDomainSharedSecretNotSupported | key,
       
    55           sharedSecretNotSupported );
       
    56 	Read( *repository,
       
    57     	  KUNSAFProtocolsDomainBindingRequestFailed | key,
       
    58           bindingRequestFailed );
       
    59 	
       
    60 	CleanupStack::PopAndDestroy( repository );
       
    61 	
       
    62 	AddIntegerResponseL( KParamUNSAFSharedSecretNotSupported,
       
    63 						 sharedSecretNotSupported );
       
    64 						 
       
    65 	AddIntegerResponseL( KParamUNSAFBindingRequestFailed,
       
    66 						 bindingRequestFailed );
       
    67 	}
       
    68 
       
    69 TBool TCmdGetDomainParams::Match( const TTcIdentifier& aId )
       
    70 	{
       
    71 	return TTcSIPCommandBase::Match( aId, _L8("GetDomainParams") );
       
    72 	}
       
    73 
       
    74 TTcCommandBase* TCmdGetDomainParams::CreateL( MTcTestContext& aContext )
       
    75 	{
       
    76 	return new( ELeave ) TCmdGetDomainParams( aContext );
       
    77 	}