|
1 // Copyright (c) 2003-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: |
|
14 // Root Server Security Policy Definitions |
|
15 // |
|
16 |
|
17 /** |
|
18 @file |
|
19 @internalComponent |
|
20 */ |
|
21 #include <rsshared.h> |
|
22 //#include <c32Exe.h> |
|
23 using namespace RootServer; |
|
24 |
|
25 /** The Symbian Vendor ID. */ |
|
26 const TUint KSymbianVID = 0x70000001; |
|
27 |
|
28 const TUint PolicyRangeCount = 17 ; |
|
29 |
|
30 // IPC ranges |
|
31 |
|
32 const TInt PolicyRanges[PolicyRangeCount] = |
|
33 { |
|
34 0, // Must start at zero to prevent CPolicyServer from panicing |
|
35 RSIsCallerConfigurator, // NetworkControl : range is 1 - 2 |
|
36 RSUnloadModule, // NetworkControl + PowerMgmt : range is 3 only |
|
37 RSBind, // NetworkControl : range is 4 only |
|
38 RSUnbind, // NetworkControl + PowerMgmt : range is 5 only |
|
39 RSGetModuleInfo, // NetworkControl : range is 6 - 10 |
|
40 RSCancelUnloadModule, // NetworkControl + PowerMgmt : range is 11 only |
|
41 RSCancelBind, // NetworkControl : range is 12 only |
|
42 RSCancelUnbind, // NetworkControl + PowerMgmt : range is 13 only |
|
43 RSCloseSession, // NetworkControl : range is 14 only |
|
44 RSShutdown, // NetworkControl + PowerMgmt : range is 15 only |
|
45 RSSendMessage, // NetworkControl : range is 16 only |
|
46 RSDbgMarkHeap, // VID+NetworkControl : range is 17 - 20 |
|
47 RSDbgFailNext +1, // fail : range is 21 - 100 |
|
48 RSSetMBufPoolSize, // NetworkControl : range is 101 - 102 |
|
49 RSDbgFailNextMbuf, // VID+NetworkControl : range is 103 - 107 |
|
50 RSDbgMbufTotalSpace + 1 // fail (to KMaxTInt)*/ : range is 108 - KMaxTInt |
|
51 }; |
|
52 |
|
53 // Index numbers into PolicyElements[] |
|
54 |
|
55 const TInt policyNetworkControl = 0; |
|
56 const TInt policyVIDandNetworkControl = 1; |
|
57 const TInt policyPass = 2; |
|
58 const TInt policyPowerNetworkControl = 3; |
|
59 |
|
60 // Mapping of IPCs to policy elements |
|
61 // |
|
62 // PowerMgmt: for IPCs that can cause termination of CPMs. |
|
63 // SymbianVID: for debug IPCs - restricted to Symbian test code (in fact, they should be DEBUG |
|
64 // only, but adding the policy for them here is fail-safe). |
|
65 |
|
66 const TUint8 PolicyElementsIndex[PolicyRangeCount] = |
|
67 { |
|
68 CPolicyServer::ENotSupported, // For fake IPC 0 - RS IPC calls start at RSSetMBufPoolSize |
|
69 policyNetworkControl, // RSIsCallerConfigurator (1) |
|
70 // RSLoadModule (2) |
|
71 policyPowerNetworkControl, // RSUnloadModule (3) |
|
72 policyNetworkControl, // RSBind (4) |
|
73 policyPowerNetworkControl, // RSUnbind (5) |
|
74 policyNetworkControl, // RSGetModuleInfo (6) |
|
75 // RSEnumerateModules (7) |
|
76 // RSEnumerateSubModules (8) |
|
77 // RSEnumerateBindings (9) |
|
78 // RSCancelLoadModule (10) |
|
79 policyPowerNetworkControl, // RSCancelUnloadModule (11) |
|
80 policyNetworkControl, // RSCancelBind (12) |
|
81 policyPowerNetworkControl, // RSCancelUnbind (13) |
|
82 policyNetworkControl, // RSCloseSession (14) |
|
83 policyPowerNetworkControl, // RSShutdown (15) |
|
84 policyNetworkControl, // RSSendMessage (16) |
|
85 policyVIDandNetworkControl, // RSDbgMarkHeap (17) |
|
86 // RSDbgCheckHeap (18) |
|
87 // RSDbgMarkEnd (19) |
|
88 // RSDbgFailNext (20) |
|
89 CPolicyServer::ENotSupported, // RSDbgFailNext + 1 to RSSetMBufPoolSize -1 |
|
90 policyNetworkControl, // RSSetMBufPoolSize (101) |
|
91 // RSAddMBufAllocInfo (102) |
|
92 policyVIDandNetworkControl, // RSDbgFailNextMbuf (103) |
|
93 // RSDbgSetMbufPoolLimit (104) |
|
94 // RSDbgCheckMbuf (105) |
|
95 // RSDbgMbufFreeSpace (106) |
|
96 // RSDbgMbufTotalSpace (107) |
|
97 |
|
98 CPolicyServer::ENotSupported // RSDbgMbufTotalSpace + 1 to KMaxTInt |
|
99 }; |
|
100 |
|
101 // Individual policy elements |
|
102 |
|
103 const CPolicyServer::TPolicyElement PolicyElements[] = |
|
104 { |
|
105 { _INIT_SECURITY_POLICY_C1(ECapabilityNetworkControl), CPolicyServer::EFailClient }, |
|
106 { _INIT_SECURITY_POLICY_V1(KSymbianVID,ECapabilityNetworkControl), CPolicyServer::EFailClient }, |
|
107 { _INIT_SECURITY_POLICY_PASS }, |
|
108 { _INIT_SECURITY_POLICY_C2(ECapabilityNetworkControl, ECapabilityPowerMgmt), CPolicyServer::EFailClient }, |
|
109 }; |
|
110 |
|
111 // Main policy |
|
112 |
|
113 const CPolicyServer::TPolicy CC32RootServerPolicy = |
|
114 { |
|
115 policyNetworkControl, // all connect attempts require NetworkControl (all IPCs require it) |
|
116 PolicyRangeCount, |
|
117 PolicyRanges, |
|
118 PolicyElementsIndex, |
|
119 PolicyElements, |
|
120 }; |
|
121 |