networksecurity/tls/protocol/tlsevent.h
changeset 0 af10295192d8
equal deleted inserted replaced
-1:000000000000 0:af10295192d8
       
     1 /**
       
     2 * Copyright (c) 2003-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:
       
    15 * SSL3.0/TLS1.0 specific asynchronous events class header file.
       
    16 * Describes an abstract, base class for SSL3.0/TLS1.0 protocol-specific
       
    17 * asynchronous events.
       
    18 * 
       
    19 *
       
    20 */
       
    21 
       
    22 
       
    23 
       
    24 /**
       
    25  @file TlsEvent.h
       
    26 */
       
    27 
       
    28 #include <comms-infras/statemachine.h>
       
    29 #include <comms-infras/asynchevent.h>
       
    30 #include "LOGFILE.H"
       
    31 #include <e32std.h>
       
    32 
       
    33 #ifndef _TLSEVENT_H_
       
    34 #define _TLSEVENT_H_
       
    35 
       
    36 
       
    37 class CTLSProvider;
       
    38 
       
    39 class CTlsEvent : public CAsynchEvent
       
    40 /**
       
    41  * Describes a SSL3.0/TLS1.0 protocol specific event (i.e. Handshake, ChangeCipherSpec, 
       
    42  * Alert and Application data protocol messages, Record composition, Record parsing, etc).
       
    43  *
       
    44  * @internalComponent
       
    45  */
       
    46 {
       
    47 public:
       
    48    CTlsEvent( CTLSProvider* aTlsProvider, CStateMachine* aStateMachine );
       
    49    virtual TBool AcceptRecord( TInt aRecordType ) const;	// Looks up an object to process a Record payload
       
    50    void SetTlsProvider( CTLSProvider* aTlsProvider );
       
    51    static TInt Offset();
       
    52    static TInt TxOffset();
       
    53 
       
    54 protected:
       
    55    CTLSProvider* iTlsProvider;	///< Reference to cryptography service provider (not required by the Alert Protocol).
       
    56    TSglQueLink iSlink;			///< Link object (Record protocol content type list)
       
    57    TSglQueLink iTxlink;			///< Link object (Transmitted message list)
       
    58 };
       
    59 
       
    60 
       
    61 // Inline functions
       
    62 
       
    63 inline CTlsEvent::CTlsEvent( CTLSProvider* aTlsProvider, CStateMachine* aStateMachine ) :
       
    64    CAsynchEvent( aStateMachine ),
       
    65    iTlsProvider( aTlsProvider )
       
    66 {
       
    67 }
       
    68 
       
    69 inline void CTlsEvent::SetTlsProvider( CTLSProvider* aTlsProvider )
       
    70 {
       
    71    iTlsProvider = aTlsProvider;
       
    72 }
       
    73 
       
    74 /**
       
    75  * Returns the offset of a CTlsEvent object. Used by the Record protocol type list.
       
    76  */
       
    77 inline TInt CTlsEvent::Offset()
       
    78 {
       
    79 	return _FOFF( CTlsEvent, iSlink );
       
    80 }
       
    81 
       
    82 /**
       
    83  * Returns the offset of a CTlsEvent object. Used by the Transmitted events list.
       
    84  */
       
    85 inline TInt CTlsEvent::TxOffset()
       
    86 {
       
    87 	return _FOFF( CTlsEvent, iTxlink );
       
    88 }
       
    89 
       
    90 #endif