vpnengine/ikev1lib/inc/ikev1isakmpstream.h
changeset 0 33413c0669b9
equal deleted inserted replaced
-1:000000000000 0:33413c0669b9
       
     1 /*
       
     2 * Copyright (c) 2007-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:  Stream class definition for ISAKMP
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef IKEV1ISAKMPSTREAM_H
       
    20 #define IKEV1ISAKMPSTREAM_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 
       
    25 class CIkev1Negotiation;
       
    26 class TInetAddr;
       
    27 class TAttrib;
       
    28 class TIdentISAKMP;
       
    29 class TAttrib_II;
       
    30 class MIkeDebug;
       
    31 
       
    32 //
       
    33 // Constructing outgoing message
       
    34 //
       
    35 class TIkev1IsakmpStream
       
    36 {
       
    37 public:
       
    38     TIkev1IsakmpStream( MIkeDebug& aDebug );
       
    39     void IsakmpInit(CIkev1Negotiation *aSession);
       
    40     void IsakmpSa();
       
    41     void IsakmpKeyL();
       
    42     void IsakmpOwnIdentL();
       
    43     void IsakmpPeerIdentL();
       
    44     void IsakmpCertificateL();
       
    45     void IsakmpCertificateReqL();
       
    46     void IsakmpHashL();
       
    47     void IsakmpHashContL();
       
    48     void IsakmpSignatureL();
       
    49     void IsakmpNonce();
       
    50     void IsakmpNotification(TUint16 aType, TUint8 aProtocol, TUint8* aNotifData = NULL, TInt aLth = 0);
       
    51     void IsakmpReplayStatus(TUint8 aProtocol, TUint32 aSPI, TUint8 aReplayWindowLength);
       
    52     void IsakmpResponderLifetime(TUint8 aProtocol, TUint32 aSPI, const TDesC8 &aLifetime, const TDesC8 &aLifesize);
       
    53     void IsakmpDelete(TDesC8 &aSPI, TUint8 aProtocol);
       
    54     void IsakmpChre(TUint16 aLAMType, TUint16 aAttr1, HBufC8 *aBfr1,
       
    55                     TUint16 aAttr2, HBufC8 *aBfr2, TUint16 aAttr3, HBufC8 *aBfr3);
       
    56     void IsakmpVendorId(TInt aID_Type, TUint8 *aICOOKIE, TUint8 *aRCOOKIE, TInetAddr &aLocalAddr,
       
    57                         TUint8 *aGenericVidData = NULL, TInt aGenericVidLth = 0);
       
    58     void IsakmpIntnet(TUint32 aIpv4Addr);
       
    59     void IsakmpNatD(TBool aRfcNatt,TDesC8 &aHash);       
       
    60     void IsakmpAttributes(TUint8 aMsgType, TUint16 aIdentifier, TDesC8 &aAttributes);  
       
    61     
       
    62 private:
       
    63     void IsakmpProposal();
       
    64     void IsakmpTransform(TUint8 *aTransform, TUint8 aNumTransforms);
       
    65     void IsakmpAttrib(TUint8 *aTransform);
       
    66     void IsakmpAttrib1(TAttrib *aTransform);
       
    67     void IsakmpAttrib2(TAttrib_II *aTransform);
       
    68     void IsakmpChreAttrib(TUint16 aType, HBufC8 *aBfr);
       
    69     void IsakmpIdentL(TBool aIsOwn);    //Own or Peer
       
    70 	void Isakmp_Phase1_IdL(TDes8& aIdData, TIdentISAKMP& aIdPayload);	
       
    71 
       
    72 private:
       
    73     CIkev1Negotiation *iNegotiation;//const 
       
    74     TUint8 *iNextPayload;
       
    75     TUint8 *iPropNextPayload;   //Used for Proposals to avoid overwritting the SA next 
       
    76                                 //field which has to be filled by other payloads
       
    77     TUint8 *iTransfNextPayload; //For Transforms 
       
    78     TInt iHash_pos;             //Stores a position to insert the hash in PHASE_II
       
    79     MIkeDebug&      iDebug;
       
    80         
       
    81 public:
       
    82     TBuf8<4096>    iBuf;
       
    83     TBool          iError;      //ETrue if any error building the message
       
    84     };
       
    85 
       
    86 
       
    87 
       
    88 #endif // IKEV1ISAKMPSTREAM_H