usbclasses/usbphoneasmodem/classimplementation/mscfileserver/inc/mscfileserversecuritypolicy.h
branchRCL_3
changeset 92 dde4619868dc
parent 83 60826dff342d
equal deleted inserted replaced
86:703a2b94c06c 92:dde4619868dc
     1 // Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    19 
    19 
    20 #include "usbmscfileshared.h"
    20 #include "usbmscfileshared.h"
    21 
    21 
    22 // USB masss storage Server Security Policy Definition
    22 // USB masss storage Server Security Policy Definition
    23 
    23 
    24 const TUint KUsbMsServerRangeCount = 2;
    24 const TUint KUsbMsServerRangeCount = 3;
    25 
    25 
    26 const TInt KUsbMsServerRanges[KUsbMsServerRangeCount] = 
    26 const TInt KUsbMsServerRanges[KUsbMsServerRangeCount] = 
    27 	{
    27 	{
    28 	EMscFileSetupLu,              // NetworkControl	[SetupLogicalUnitL/StartL/Stop/Shutdown]
    28 	EMscFileStart,                // NetworkControl	[StartL/Stop]
       
    29 	EMscFileShutdown,				// DiskAdmin		[Shutdown]
    29     EMscFileShutdown + 1,         // fail (to KMaxInt)
    30     EMscFileShutdown + 1,         // fail (to KMaxInt)
    30 	};
    31 	};
    31 
    32 
    32 // Index numbers into KUsbMsServerElements[]
    33 // Index numbers into KUsbMsServerElements[]
    33 const TInt KPolicyNetworkControl = 0;
    34 const TInt KPolicyNetworkControl = 0;
       
    35 const TInt KPolicyDiskAdmin = 1;
    34 
    36 
    35 // Mapping IPCs to poicy element
    37 // Mapping IPCs to poicy element
    36 const TUint8 KUsbMsServerElementsIndex[KUsbMsServerRangeCount] = 
    38 const TUint8 KUsbMsServerElementsIndex[KUsbMsServerRangeCount] = 
    37 	{
    39 	{
    38 	KPolicyNetworkControl,          // EMscFileSetupLu, EMscFileStart, EMscFileStop, EMscFileShutdown
    40 	KPolicyNetworkControl,          // EMscFileStart & EMscFileStop 
       
    41 	KPolicyDiskAdmin,			 	// EMscFileShutdown 
    39 	CPolicyServer::ENotSupported,   // EMscFileShutdown + 1 to KMaxTInt    
    42 	CPolicyServer::ENotSupported,   // EMscFileShutdown + 1 to KMaxTInt    
    40 	};
    43 	};
    41 
    44 
    42 // Individual policy elements 
    45 // Individual policy elements 
    43 const CPolicyServer::TPolicyElement KUsbMsServerElements[] = 
    46 const CPolicyServer::TPolicyElement KUsbMsServerElements[] = 
    44 	{
    47 	{
    45   		{ _INIT_SECURITY_POLICY_C1(ECapabilityNetworkControl), CPolicyServer::EFailClient },
    48   		{ _INIT_SECURITY_POLICY_C1(ECapabilityNetworkControl), CPolicyServer::EFailClient },
       
    49 		{ _INIT_SECURITY_POLICY_C1(ECapabilityDiskAdmin), CPolicyServer::EFailClient},
    46 		// the EFailClient means that if the check fails 
    50 		// the EFailClient means that if the check fails 
    47         // the CheckFailed method with return KErrPermissionDenied
    51         // the CheckFailed method with return KErrPermissionDenied
    48 	};
    52 	};
    49 
    53 
    50 // Main policy
    54 // Main policy