gba/gbaserver/inc/GbaServerPolicy.h
changeset 0 164170e6151a
equal deleted inserted replaced
-1:000000000000 0:164170e6151a
       
     1 /*
       
     2 * Copyright (c) 2007 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:  GBA Server Policy definitions
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef   GBASERVERPOLICY_H
       
    20 #define   GBASERVERPOLICY_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include "GbaCommon.h"
       
    24 
       
    25 // Panic Category 
       
    26 _LIT(KGbaServer, "gbaserver2");
       
    27 
       
    28 
       
    29 // Total number of policy ranges
       
    30 const TUint KGBARangeCount = 5;
       
    31 
       
    32 const TInt GBARanges[KGBARangeCount] =
       
    33     {
       
    34     EGbaServRequestBootstrap,             // Range 0  
       
    35     EGbaServCancelRequestBootstrap,       // Range 1
       
    36     EGbaServWriteOption,                  // Range 2
       
    37     EGbaServIsGBAUSupported,              // Range 3 
       
    38     EGbaServIsGBAUSupported+1             // Range 4
       
    39     };                                    
       
    40 
       
    41 // Policy to implement for each of the ranges in range table.
       
    42 const TUint8 GBAElementsIndex[KGBARangeCount] =
       
    43     {
       
    44     1,                                    // ReadDeviceData is required for bootstrap 
       
    45     CPolicyServer::EAlwaysPass,           // No cap required for cancel bootstrap
       
    46     0,                                    // WriteDeviceData is required for write options
       
    47     1,                                    // ReadDeviceData is required for checking gba-u 
       
    48     CPolicyServer::ENotSupported          // applies to 5th range (out of range IPC)
       
    49     };
       
    50 
       
    51 // Specific capability checks.
       
    52 const CPolicyServer::TPolicyElement GBAElements[] =
       
    53     {
       
    54         // policy "0"; 
       
    55         {
       
    56         _INIT_SECURITY_POLICY_C1( ECapabilityWriteDeviceData ),
       
    57         CPolicyServer::EFailClient
       
    58         },
       
    59         // policy "1"; 
       
    60         {
       
    61         _INIT_SECURITY_POLICY_C1( ECapabilityReadDeviceData ),
       
    62         CPolicyServer::EFailClient
       
    63         }
       
    64     };
       
    65 
       
    66 // Packs all the security definitions into a policy.
       
    67 const CPolicyServer::TPolicy GBAPolicy =
       
    68     {
       
    69     CPolicyServer::EAlwaysPass, // all connect attempts should pass
       
    70     KGBARangeCount,             // number of ranges
       
    71     GBARanges,                  // ranges array
       
    72     GBAElementsIndex,           // elements<->ranges index
       
    73     GBAElements,                // array of elements
       
    74     };
       
    75 
       
    76 #endif //GBASERVERPOLICY_H