boottimeintegritycheck/inc/IntegrityCheckServer.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:  Server header file
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef INTEGRITYCHECKSERVER_H
       
    20 #define INTEGRITYCHECKSERVER_H
       
    21 
       
    22 // INCLUDES
       
    23 
       
    24 #include <e32std.h>
       
    25 #include <e32base.h>
       
    26 #include <e32cons.h>
       
    27 #include <e32svr.h>
       
    28 #include <f32file.h>
       
    29 
       
    30 // CONSTANTS
       
    31 
       
    32 _LIT( KIntecrityCheckServer,"IntegrityCheckServer" );
       
    33 _LIT( KIntecrityCheckServerName,"!IntegrityCheckServer" );
       
    34 _LIT( KIntecrityCheckServerText,"Boot Time Integrity Check Server" );
       
    35 
       
    36 const TInt KParam0 = 0;
       
    37 // BTIC Server auto close time.
       
    38 const TInt KServerCloseTime = 8000000; // 8 sec.
       
    39 
       
    40 // ---------------------------------------------------------------------------
       
    41 // Server's policy 
       
    42 // ---------------------------------------------------------------------------
       
    43 
       
    44 //Total number of ranges
       
    45 const TUint CPRangeCount = 2;
       
    46 
       
    47 //Definition of the ranges of IPC numbers
       
    48 const TInt CPRanges[CPRangeCount] =
       
    49         {
       
    50         0,
       
    51         1
       
    52         };
       
    53 
       
    54 //Policy to implement for each of the above ranges
       
    55 const TUint8 CPElementsIndex[CPRangeCount] =
       
    56         {
       
    57         0,
       
    58         CPolicyServer::ENotSupported
       
    59         };
       
    60 
       
    61 //Specific capability checks
       
    62 const CPolicyServer::TPolicyElement CPElements[] =
       
    63         {
       
    64         {_INIT_SECURITY_POLICY_C1(ECapabilityReadDeviceData), 
       
    65         CPolicyServer::EPanicClient},
       
    66         };
       
    67 
       
    68 //Package all the above together into a policy
       
    69 const CPolicyServer::TPolicy CPPolicy =
       
    70         {
       
    71         CPolicyServer::EAlwaysPass, // All connect attempts pass
       
    72         CPRangeCount,               // Number of ranges
       
    73         CPRanges,                   // Ranges array
       
    74         CPElementsIndex,            // Elements<->ranges index
       
    75         CPElements,                 // Array of elements
       
    76         };
       
    77 
       
    78 // CLASS DECLARATION
       
    79 
       
    80 // MACROS
       
    81 
       
    82 // DATA TYPES 
       
    83 
       
    84 // FUNCTION PROTOTYPES 
       
    85 
       
    86 // FORWARD DECLARATIONS
       
    87 
       
    88 // LOCAL FUNCTION PROTOTYPES 
       
    89 
       
    90 // CLASS DECLARATION 
       
    91 
       
    92 /**
       
    93 *  CShutdown class
       
    94 *
       
    95 *  @lib
       
    96 */
       
    97 class CShutdown : public CTimer
       
    98     {
       
    99     public:
       
   100         CShutdown();           
       
   101         void ConstructL();               
       
   102         void Start();
       
   103         
       
   104     private:
       
   105         void RunL();        
       
   106     };
       
   107 
       
   108 /**
       
   109 *  CIntegrityCheckServer class
       
   110 *
       
   111 *  @lib
       
   112 *  @since 3.1
       
   113 */
       
   114 class CIntegrityCheckServer : public CPolicyServer
       
   115     {
       
   116     public:
       
   117     
       
   118         static CServer2* NewLC();
       
   119         
       
   120         void AddSession();
       
   121         
       
   122         void RemoveSession();        
       
   123 
       
   124     private:
       
   125     
       
   126         /**
       
   127         * Default constructor        
       
   128         */
       
   129         CIntegrityCheckServer();
       
   130 
       
   131         void ConstructL();
       
   132         
       
   133         /**
       
   134         * From CServer2
       
   135         */       
       
   136         virtual CSession2* NewSessionL( 
       
   137             const TVersion& aVersion, 
       
   138             const RMessage2& aMessage ) const;       
       
   139         
       
   140     private:
       
   141         TInt iSessionCount;
       
   142         CShutdown iShutDown;       
       
   143     };
       
   144 
       
   145 /**
       
   146 *  CIntegrityCheckSession class
       
   147 *  Class for Integrity Check server session
       
   148 *
       
   149 *  @lib
       
   150 *  @since 3.1
       
   151 */
       
   152 class CIntegrityCheckSession : public CSession2
       
   153     {
       
   154     public:
       
   155     
       
   156         /**
       
   157         * Constructor        
       
   158         */
       
   159         CIntegrityCheckSession();
       
   160         
       
   161         /**
       
   162         * Called by the CServer2 framework after constructor.
       
   163         */       
       
   164         void CreateL();
       
   165  
       
   166         /**
       
   167          * Called by the CServer2 framework after client close.
       
   168          */     
       
   169         void Disconnect( const RMessage2 &aMessage );
       
   170 
       
   171     private:
       
   172     
       
   173         /**
       
   174         * Destructor.
       
   175         *
       
   176         */
       
   177         ~CIntegrityCheckSession();
       
   178                 
       
   179         void ServiceL( const RMessage2& aMessage );        
       
   180 
       
   181         void ServiceError( const RMessage2& aMessage, TInt aError );
       
   182 
       
   183         /**
       
   184         * Get device sw boot reason
       
   185         * @param aMessage user parameters        
       
   186         */
       
   187         void GetSWBootReasonL( const RMessage2& aMessage );
       
   188 
       
   189     private: // Data
       
   190                 
       
   191 
       
   192     };
       
   193 
       
   194 #endif  // INTEGRITYCHECKSERVER_H
       
   195 
       
   196 //EOF