userlibandfileserver/fileserver/smassstorage/inc/usbmsserversecuritypolicy.h
changeset 0 a41df078684a
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     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 the License "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 // USB mass storage Server Security Policy definitions for Platform security.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file 
       
    20  @internalComponent
       
    21 */
       
    22  
       
    23 #if !defined(__USBMSSERVERSECURITYPOLICY_H__)
       
    24 #define __USBMSSERVERSECURITYPOLICY_H__
       
    25 
       
    26 #include <usbmsshared.h>
       
    27 
       
    28 // USB masss storage Server Security Policy Definition
       
    29 
       
    30 const TUint KUsbMsServerRangeCount = 3;
       
    31 
       
    32 const TInt KUsbMsServerRanges[KUsbMsServerRangeCount] = 
       
    33 	{
       
    34 	EUsbMsStart,                // NetworkControl	[Start/Stop]
       
    35 	EUsbMsShutdown,				// DiskAdmin		[Shutdown]
       
    36     EUsbMsShutdown + 1,         // fail (to KMaxInt)
       
    37 	};
       
    38 
       
    39 // Index numbers into KUsbMsServerElements[]
       
    40 const TInt KPolicyNetworkControl = 0;
       
    41 const TInt KPolicyDiskAdmin = 1;
       
    42 
       
    43 // Mapping IPCs to poicy element
       
    44 const TUint8 KUsbMsServerElementsIndex[KUsbMsServerRangeCount] = 
       
    45 	{
       
    46 	KPolicyNetworkControl,          // EUsbMsStart & EUsbMsStop 
       
    47 	KPolicyDiskAdmin,			 	// EUsbMsShutdown 
       
    48 	CPolicyServer::ENotSupported,   // EUsbMsShutdown + 1 to KMaxTInt    
       
    49 	};
       
    50 
       
    51 // Individual policy elements 
       
    52 const CPolicyServer::TPolicyElement KUsbMsServerElements[] = 
       
    53 	{
       
    54   		{ _INIT_SECURITY_POLICY_C1(ECapabilityNetworkControl), CPolicyServer::EFailClient },
       
    55 		{ _INIT_SECURITY_POLICY_C1(ECapabilityDiskAdmin), CPolicyServer::EFailClient},
       
    56 		// the EFailClient means that if the check fails 
       
    57         // the CheckFailed method with return KErrPermissionDenied
       
    58 	};
       
    59 
       
    60 // Main policy
       
    61 const CPolicyServer::TPolicy KUsbMsServerPolicy = 
       
    62 	{
       
    63 	CPolicyServer::EAlwaysPass, // all connect attempts should pass
       
    64 	KUsbMsServerRangeCount,
       
    65 	KUsbMsServerRanges,
       
    66 	KUsbMsServerElementsIndex,
       
    67 	KUsbMsServerElements,
       
    68 	};
       
    69 #endif //__USBMSSERVERSECURITYPOLICY_H__