vpnengine/kmdserver/inc/secpolreader.h
changeset 0 33413c0669b9
equal deleted inserted replaced
-1:000000000000 0:33413c0669b9
       
     1 /*
       
     2 * Copyright (c) 1999-2009 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 module
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_SECPOLREADER_H
       
    20 #define C_SECPOLREADER_H
       
    21 
       
    22 #include <es_sock.h>
       
    23 #include <in_sock.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class MIkeDebug;
       
    27 class MKmdEventLoggerIf;
       
    28 
       
    29 const TInt KMaxSecpolMsgSize( 1000 );
       
    30 
       
    31 /**
       
    32  *  Secpol reader.
       
    33  *  Class for reading messages from SECPOL socket.
       
    34  *
       
    35  *  @lib internal (kmdserver.exe)
       
    36  */
       
    37 class CSecpolReader : public CActive
       
    38     {
       
    39 public:
       
    40     /**
       
    41      * Two-phased constructor.
       
    42      * @param aEventLogger Event logger
       
    43      * @param aDebug Debug trace interface
       
    44      */
       
    45     static CSecpolReader* NewL( MKmdEventLoggerIf& aEventLogger,
       
    46                                 MIkeDebug& aDebug );
       
    47 
       
    48     /**
       
    49      * Destructor.
       
    50      */
       
    51     ~CSecpolReader();
       
    52 
       
    53 // from base class CActive
       
    54     
       
    55     /**
       
    56      * From CActive
       
    57      * Handles completion of asynchronous reading.
       
    58      */    
       
    59     void RunL();
       
    60     
       
    61     /**
       
    62      * From CActive
       
    63      * Handles cancellation of asynchronous reading.
       
    64      */    
       
    65     void DoCancel();     
       
    66 
       
    67 private:
       
    68     CSecpolReader( MKmdEventLoggerIf& aEventLogger,
       
    69                    MIkeDebug& aDebug );
       
    70     void ConstructL();
       
    71     
       
    72     /**
       
    73      * Returns event logger.
       
    74      * @return Event logger
       
    75      */
       
    76     MKmdEventLoggerIf& EventLogger();
       
    77     
       
    78 private: // data
       
    79 
       
    80     /**
       
    81      * Socket server.
       
    82      * Own.
       
    83      */
       
    84     RSocketServ                 iSocketServer;
       
    85     
       
    86     /**
       
    87      * Secpol socket.
       
    88      * Own.
       
    89      */
       
    90     RSocket                     iSocket;
       
    91     
       
    92     /**
       
    93      * Secpol message.
       
    94      * Own.
       
    95      */
       
    96     TBuf8<KMaxSecpolMsgSize>    iMsg;
       
    97     
       
    98     /**
       
    99      * Remote source address.
       
   100      * Own.
       
   101      */
       
   102     TInetAddr                   iAddr;
       
   103     
       
   104     /**
       
   105      * Event logger.
       
   106      * Not own.
       
   107      */
       
   108     MKmdEventLoggerIf&          iEventLogger;
       
   109     
       
   110     /**
       
   111      * Debug trace interface.
       
   112      * Not own.
       
   113      */
       
   114     MIkeDebug&                  iDebug;
       
   115     };
       
   116 
       
   117 #endif // C_SECPOLREADER_H