|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Security policy for BTEng client-server interface. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef BTENGSECPOLICY_H |
|
21 #define BTENGSECPOLICY_H |
|
22 |
|
23 |
|
24 /** BTEng policy range count */ |
|
25 const TUint KBTEngRangeCount = 5; |
|
26 |
|
27 /** Ranges of BTEng opcodes */ |
|
28 const TInt KBTEngRanges[ KBTEngRangeCount ] = |
|
29 { |
|
30 0, // Range 0: 0 - 32 (Out of range) |
|
31 33, // Range 1: EBTEngSetPowerState |
|
32 // EBTEngSetScanMode |
|
33 35, // Range 2: EBTEngConnectDevice |
|
34 // EBTEngCancelConnectDevice |
|
35 // EBTEngDisconnectDevice |
|
36 // EBTEngIsDeviceConnected |
|
37 // EBTEngIsDeviceConnectable |
|
38 // EBTEngGetConnectedAddresses |
|
39 // EBTEngNotifyConnectionEvents |
|
40 // EBTEngCancelEventNotifier |
|
41 // EBTEngPrepareDiscovery |
|
42 44, // Range 3: EBTEngSetPairingObserver |
|
43 // EBTEngPairDevice |
|
44 // EBTEngCancelPairDevice |
|
45 47 // Range x: Out of range |
|
46 }; |
|
47 |
|
48 /** Mapping of ranges to policies */ |
|
49 const TUint8 KBTEngElementsIndex[ KBTEngRangeCount ] = |
|
50 { |
|
51 CPolicyServer::ENotSupported, //applies to 0th range (out of range) |
|
52 1, //policy 1 applies to 1st range |
|
53 0, //policy 0 applies to 2nd range |
|
54 1, //policy 1 applies to 3rd range |
|
55 CPolicyServer::ENotSupported //applies to 9th range(out of range IPC) |
|
56 }; |
|
57 |
|
58 /** BTEng security policies */ |
|
59 const CPolicyServer::TPolicyElement KBTEngPolicyElements[] = |
|
60 { |
|
61 { _INIT_SECURITY_POLICY_C1( ECapabilityLocalServices ), |
|
62 CPolicyServer::EFailClient |
|
63 }, //policy 0, connection management operations |
|
64 { _INIT_SECURITY_POLICY_C2( ECapabilityLocalServices, ECapabilityWriteDeviceData ), |
|
65 CPolicyServer::EFailClient |
|
66 } //policy 1, write HW settings |
|
67 }; |
|
68 |
|
69 /** BTEng security policy package */ |
|
70 const CPolicyServer::TPolicy KBTEngServerPolicy = |
|
71 { |
|
72 CPolicyServer::EAlwaysPass, // Connection attempts may pass |
|
73 KBTEngRangeCount, // Number of ranges |
|
74 KBTEngRanges, // Array of ranges |
|
75 KBTEngElementsIndex, // Mapping of ranges to policies |
|
76 KBTEngPolicyElements // Array of policies |
|
77 }; |
|
78 |
|
79 |
|
80 #endif // BTENGSECPOLICY_H |