vpnengine/vpnmanager/inc/vpnmanagerserver.h
changeset 0 33413c0669b9
child 2 ef893827b4d1
equal deleted inserted replaced
-1:000000000000 0:33413c0669b9
       
     1 /*
       
     2 * Copyright (c) 2000-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: 
       
    15 * Server component for VPN (Ext) Manager, used by VPN (Ext) API. 
       
    16 * VPN Ext API uses the definition, but provides its own implementation.
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 #ifndef __VPNMANAGERSERVER_H__
       
    23 #define __VPNMANAGERSERVER_H__
       
    24 
       
    25 #include <e32base.h>
       
    26 #include <f32file.h>
       
    27 #include "vpnmanagerserverdefs.h"
       
    28 
       
    29 class CRequestDispatcher;
       
    30 
       
    31 /** 
       
    32  * The main server class
       
    33  */
       
    34 class CVpnManagerServer : public CPolicyServer
       
    35     {
       
    36 public:
       
    37 
       
    38     /**
       
    39      * Create a CVpnManagerServer object using two phase construction,
       
    40      * and return a pointer to the created object
       
    41      * 
       
    42      * @result pointer to created CVpnManagerServer object
       
    43      */
       
    44     static CVpnManagerServer* NewL();
       
    45 
       
    46     /**
       
    47      * Create a CVpnManagerServer object using two phase construction,
       
    48      * and return a pointer to the created object, leaving a pointer
       
    49      * to the object on the cleanup stack.
       
    50      * 
       
    51      * Pointer to created CVpnManagerServer object
       
    52      */
       
    53     static CVpnManagerServer* NewLC();
       
    54 
       
    55     /**
       
    56      * Destroy the object and release all memory objects
       
    57      */
       
    58     ~CVpnManagerServer();
       
    59 
       
    60     /**
       
    61      * Increments the count of the active sessions for this server
       
    62      */
       
    63 	void IncrementSessions();
       
    64 
       
    65     /**
       
    66      * Decrements the count of the active sessions for this server.
       
    67      * If no more sessions are in use the server terminates.
       
    68      */
       
    69 	void DecrementSessions();
       
    70 
       
    71 protected: // From CActive
       
    72     /**
       
    73      * Process any errors
       
    74      * 
       
    75      * @param aError the leave code reported
       
    76      */
       
    77 	TInt RunError(TInt aError);
       
    78 
       
    79 private:
       
    80 
       
    81     /**
       
    82      * Perform the first phase of two phase construction
       
    83      * 
       
    84      * @param Priority for this thread
       
    85      */
       
    86     CVpnManagerServer(TInt aPriority);
       
    87 
       
    88     /**
       
    89      * Perform the second phase construction of a CVpnManagerServer object
       
    90      */
       
    91     void ConstructL() ;
       
    92 
       
    93 private: // From CServer
       
    94 
       
    95     /**
       
    96      * Create a time server session, and return a pointer to the
       
    97      * created object
       
    98      * 
       
    99      * @param Version
       
   100      * 
       
   101      * @result Pointer to the new session
       
   102      */ 
       
   103 	CSession2* NewSessionL(const TVersion& aVersion,const RMessage2& aMessage) const;
       
   104 
       
   105 private:
       
   106     /** The number of client-server sessions */
       
   107     TInt iSessionCount;
       
   108 
       
   109     /** The handler of client requests */
       
   110     CRequestDispatcher* iRequestDispatcher;
       
   111     
       
   112     /** The common file server session used throughout the VPN Manager */ 
       
   113     RFs iFs;
       
   114     
       
   115 	static const TUint iVpnManRangeCount;
       
   116 	static const TInt iVpnManRanges[];
       
   117 	static const TUint8 iVpnManElementIndex[];
       
   118 
       
   119     static const CPolicyServer::TPolicyElement iVpnManElements[];
       
   120     static const CPolicyServer::TPolicy iVpnManPolicy;
       
   121     };
       
   122 
       
   123 
       
   124 #endif // __VPNMANAGERSERVER_H__
       
   125