usbclasses/usbphoneasmodem/classimplementation/mscfileserver/inc/mscfileserversecuritypolicy.h
changeset 35 9d8b04ca6939
child 63 ef2686f7597e
child 81 842c592edba7
equal deleted inserted replaced
34:7858bc6ead78 35:9d8b04ca6939
       
     1 // Copyright (c) 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: USB mass storage Server Security Policy definitions for Platform security.
       
    14 // 
       
    15 // 
       
    16 
       
    17 #ifndef MSCFILESERVERSECURITYPOLICY_H
       
    18 #define MSCFILESERVERSECURITYPOLICY_H
       
    19 
       
    20 #include "usbmscfileshared.h"
       
    21 
       
    22 // USB masss storage Server Security Policy Definition
       
    23 
       
    24 const TUint KUsbMsServerRangeCount = 3;
       
    25 
       
    26 const TInt KUsbMsServerRanges[KUsbMsServerRangeCount] = 
       
    27 	{
       
    28 	EMscFileStart,                // NetworkControl	[StartL/Stop]
       
    29 	EMscFileShutdown,				// DiskAdmin		[Shutdown]
       
    30     EMscFileShutdown + 1,         // fail (to KMaxInt)
       
    31 	};
       
    32 
       
    33 // Index numbers into KUsbMsServerElements[]
       
    34 const TInt KPolicyNetworkControl = 0;
       
    35 const TInt KPolicyDiskAdmin = 1;
       
    36 
       
    37 // Mapping IPCs to poicy element
       
    38 const TUint8 KUsbMsServerElementsIndex[KUsbMsServerRangeCount] = 
       
    39 	{
       
    40 	KPolicyNetworkControl,          // EMscFileStart & EMscFileStop 
       
    41 	KPolicyDiskAdmin,			 	// EMscFileShutdown 
       
    42 	CPolicyServer::ENotSupported,   // EMscFileShutdown + 1 to KMaxTInt    
       
    43 	};
       
    44 
       
    45 // Individual policy elements 
       
    46 const CPolicyServer::TPolicyElement KUsbMsServerElements[] = 
       
    47 	{
       
    48   		{ _INIT_SECURITY_POLICY_C1(ECapabilityNetworkControl), CPolicyServer::EFailClient },
       
    49 		{ _INIT_SECURITY_POLICY_C1(ECapabilityDiskAdmin), CPolicyServer::EFailClient},
       
    50 		// the EFailClient means that if the check fails 
       
    51         // the CheckFailed method with return KErrPermissionDenied
       
    52 	};
       
    53 
       
    54 // Main policy
       
    55 const CPolicyServer::TPolicy KMscFileServerPolicy = 
       
    56 	{
       
    57 	CPolicyServer::EAlwaysPass, // all connect attempts should pass
       
    58 	KUsbMsServerRangeCount,
       
    59 	KUsbMsServerRanges,
       
    60 	KUsbMsServerElementsIndex,
       
    61 	KUsbMsServerElements,
       
    62 	};
       
    63 #endif //MSCFILESERVERSECURITYPOLICY_H