os/kernelhwsrv/userlibandfileserver/fileserver/smassstorage/inc/usbmsserversecuritypolicy.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/userlibandfileserver/fileserver/smassstorage/inc/usbmsserversecuritypolicy.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,69 @@
     1.4 +// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// USB mass storage Server Security Policy definitions for Platform security.
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +/**
    1.22 + @file 
    1.23 + @internalComponent
    1.24 +*/
    1.25 + 
    1.26 +#if !defined(__USBMSSERVERSECURITYPOLICY_H__)
    1.27 +#define __USBMSSERVERSECURITYPOLICY_H__
    1.28 +
    1.29 +#include <usbmsshared.h>
    1.30 +
    1.31 +// USB masss storage Server Security Policy Definition
    1.32 +
    1.33 +const TUint KUsbMsServerRangeCount = 3;
    1.34 +
    1.35 +const TInt KUsbMsServerRanges[KUsbMsServerRangeCount] = 
    1.36 +	{
    1.37 +	EUsbMsStart,                // NetworkControl	[Start/Stop]
    1.38 +	EUsbMsShutdown,				// DiskAdmin		[Shutdown]
    1.39 +    EUsbMsShutdown + 1,         // fail (to KMaxInt)
    1.40 +	};
    1.41 +
    1.42 +// Index numbers into KUsbMsServerElements[]
    1.43 +const TInt KPolicyNetworkControl = 0;
    1.44 +const TInt KPolicyDiskAdmin = 1;
    1.45 +
    1.46 +// Mapping IPCs to poicy element
    1.47 +const TUint8 KUsbMsServerElementsIndex[KUsbMsServerRangeCount] = 
    1.48 +	{
    1.49 +	KPolicyNetworkControl,          // EUsbMsStart & EUsbMsStop 
    1.50 +	KPolicyDiskAdmin,			 	// EUsbMsShutdown 
    1.51 +	CPolicyServer::ENotSupported,   // EUsbMsShutdown + 1 to KMaxTInt    
    1.52 +	};
    1.53 +
    1.54 +// Individual policy elements 
    1.55 +const CPolicyServer::TPolicyElement KUsbMsServerElements[] = 
    1.56 +	{
    1.57 +  		{ _INIT_SECURITY_POLICY_C1(ECapabilityNetworkControl), CPolicyServer::EFailClient },
    1.58 +		{ _INIT_SECURITY_POLICY_C1(ECapabilityDiskAdmin), CPolicyServer::EFailClient},
    1.59 +		// the EFailClient means that if the check fails 
    1.60 +        // the CheckFailed method with return KErrPermissionDenied
    1.61 +	};
    1.62 +
    1.63 +// Main policy
    1.64 +const CPolicyServer::TPolicy KUsbMsServerPolicy = 
    1.65 +	{
    1.66 +	CPolicyServer::EAlwaysPass, // all connect attempts should pass
    1.67 +	KUsbMsServerRangeCount,
    1.68 +	KUsbMsServerRanges,
    1.69 +	KUsbMsServerElementsIndex,
    1.70 +	KUsbMsServerElements,
    1.71 +	};
    1.72 +#endif //__USBMSSERVERSECURITYPOLICY_H__