bluetoothengine/btnotif/btnotifsrv/inc/btnotifserversecpolicy.h
branchRCL_3
changeset 56 9386f31cc85b
parent 55 613943a21004
child 61 269724087bed
equal deleted inserted replaced
55:613943a21004 56:9386f31cc85b
     1 /*
       
     2 * ============================================================================
       
     3 *  Name        : btnotifserversecpolicy.h
       
     4 *  Part of     : bluetoothengine / btnotif       *** Info from the SWAD
       
     5 *  Description : Security policy for btnotif client-server interface.
       
     6 *
       
     7 *  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     8 *  All rights reserved.
       
     9 *  This component and the accompanying materials are made available
       
    10 *  under the terms of "Eclipse Public License v1.0"
       
    11 *  which accompanies this distribution, and is available
       
    12 *  at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
    13 *
       
    14 *  Initial Contributors:
       
    15 *  Nokia Corporation - initial contribution.
       
    16 *
       
    17 *  Contributors:
       
    18 *  Nokia Corporation
       
    19 * ============================================================================
       
    20 * Template version: 4.2
       
    21 */
       
    22 
       
    23 #ifndef BTNOTIFSRVSECPOLICY_H
       
    24 #define BTNOTIFSRVSECPOLICY_H
       
    25 
       
    26 /**  Number of ranges in btnotif security policy */
       
    27 const TInt KBTNotifRangeCount = 4;
       
    28 
       
    29 /**  Ranges of btnotif command opcodes */
       
    30 const TInt KBTNotifRanges[ KBTNotifRangeCount ] = 
       
    31     {
       
    32     0,  // Range 0: 0 - EBTNotifMinValue (Out of range)
       
    33     10, // Range 1: All commands requiring no access control
       
    34     30, // Range 2: All commands requiring local services
       
    35         // More ranges may be added here
       
    36     50  // Range 3: Out of range
       
    37     };
       
    38 
       
    39 /**  Mapping of ranges to policies */
       
    40 const TUint8 KBTNotifElementsIndex[ KBTNotifRangeCount ] = 
       
    41     {
       
    42     CPolicyServer::ENotSupported,   // applies to 0th range (out of range)
       
    43     CPolicyServer::EAlwaysPass,     // no policy for the 1st range
       
    44     0,                              // policy 0 applies to 2nd range
       
    45     CPolicyServer::ENotSupported    // applies to xth range(out of range)
       
    46     };
       
    47 
       
    48 /**  BTEng security policies, applied on a range of commands */
       
    49 const CPolicyServer::TPolicyElement KBTNotifPolicyElements[] = 
       
    50     {
       
    51         { _INIT_SECURITY_POLICY_C1( ECapabilityLocalServices ), 
       
    52           CPolicyServer::EFailClient
       
    53         } //policy 0, for now on all operations
       
    54         // More policies may be added here
       
    55     };
       
    56 
       
    57 /**  BTNotif security policy package (combining all the above) */
       
    58 const CPolicyServer::TPolicy KBTNotifServerPolicy = 
       
    59     {
       
    60     CPolicyServer::EAlwaysPass, // Connection attempts may pass
       
    61     KBTNotifRangeCount,         // Number of ranges
       
    62     KBTNotifRanges,             // Array of ranges
       
    63     KBTNotifElementsIndex,      // Mapping of ranges to policies
       
    64     KBTNotifPolicyElements      // Array of policies
       
    65     };
       
    66 
       
    67 #endif // BTNOTIFSRVSECPOLICY_H