1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2009-2010 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 = 3; |
24 const TUint KUsbMsServerRangeCount = 2; |
25 |
25 |
26 const TInt KUsbMsServerRanges[KUsbMsServerRangeCount] = |
26 const TInt KUsbMsServerRanges[KUsbMsServerRangeCount] = |
27 { |
27 { |
28 EMscFileStart, // NetworkControl [StartL/Stop] |
28 EMscFileSetupLu, // NetworkControl [SetupLogicalUnitL/StartL/Stop/Shutdown] |
29 EMscFileShutdown, // DiskAdmin [Shutdown] |
|
30 EMscFileShutdown + 1, // fail (to KMaxInt) |
29 EMscFileShutdown + 1, // fail (to KMaxInt) |
31 }; |
30 }; |
32 |
31 |
33 // Index numbers into KUsbMsServerElements[] |
32 // Index numbers into KUsbMsServerElements[] |
34 const TInt KPolicyNetworkControl = 0; |
33 const TInt KPolicyNetworkControl = 0; |
35 const TInt KPolicyDiskAdmin = 1; |
|
36 |
34 |
37 // Mapping IPCs to poicy element |
35 // Mapping IPCs to poicy element |
38 const TUint8 KUsbMsServerElementsIndex[KUsbMsServerRangeCount] = |
36 const TUint8 KUsbMsServerElementsIndex[KUsbMsServerRangeCount] = |
39 { |
37 { |
40 KPolicyNetworkControl, // EMscFileStart & EMscFileStop |
38 KPolicyNetworkControl, // EMscFileSetupLu, EMscFileStart, EMscFileStop, EMscFileShutdown |
41 KPolicyDiskAdmin, // EMscFileShutdown |
|
42 CPolicyServer::ENotSupported, // EMscFileShutdown + 1 to KMaxTInt |
39 CPolicyServer::ENotSupported, // EMscFileShutdown + 1 to KMaxTInt |
43 }; |
40 }; |
44 |
41 |
45 // Individual policy elements |
42 // Individual policy elements |
46 const CPolicyServer::TPolicyElement KUsbMsServerElements[] = |
43 const CPolicyServer::TPolicyElement KUsbMsServerElements[] = |
47 { |
44 { |
48 { _INIT_SECURITY_POLICY_C1(ECapabilityNetworkControl), CPolicyServer::EFailClient }, |
45 { _INIT_SECURITY_POLICY_C1(ECapabilityNetworkControl), CPolicyServer::EFailClient }, |
49 { _INIT_SECURITY_POLICY_C1(ECapabilityDiskAdmin), CPolicyServer::EFailClient}, |
|
50 // the EFailClient means that if the check fails |
46 // the EFailClient means that if the check fails |
51 // the CheckFailed method with return KErrPermissionDenied |
47 // the CheckFailed method with return KErrPermissionDenied |
52 }; |
48 }; |
53 |
49 |
54 // Main policy |
50 // Main policy |