vpnengine/ikev2lib/inc/ipsecselectors.h
changeset 0 33413c0669b9
equal deleted inserted replaced
-1:000000000000 0:33413c0669b9
       
     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: IPSec Traffic Selector handling.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __IPSECSELECTORS_H_
       
    19 #define __IPSECSELECTORS_H_
       
    20 #include <e32base.h>
       
    21 
       
    22 class TPfkeyMessage;
       
    23 class TTSPayloadIkev2;
       
    24 class TTrafficSelector;
       
    25 class TInetAddr;
       
    26 class TPfkeyIdentity;
       
    27 class CIkev2Acquire;
       
    28 class CIkev2PluginSession;
       
    29 class CIkev2Payloads;
       
    30 class TIkeV2TrafficSelector;
       
    31 class CIkev2PluginSession;
       
    32 
       
    33 class IpsecSelectors
       
    34 {
       
    35 public:
       
    36     /**
       
    37      * Add aDhGroup, if PFS is used.
       
    38      */
       
    39 	static CIkev2Acquire* GetIpsecPolicyL(CIkev2PluginSession& aPluginSession, CIkev2Payloads* aIkeMsg, TInt aDhGroup = 0);
       
    40 	static CIkev2Acquire* BuildVirtualAcquireL(CIkev2PluginSession& aPluginSession);	
       
    41 	static TBool VerifyTrafficSelectorsL(CIkev2Acquire* aAcquire, TTSPayloadIkev2* aTsI, TTSPayloadIkev2* aTsR );
       
    42 	static void BuildTrafficSelectorsL(CIkev2Acquire* aAcquire, const TInetAddr& aLocalAddr,
       
    43                                        const TPfkeyIdentity& aSrcIdent, const TPfkeyIdentity& aDstIdent,
       
    44                                        TUint8 aProtocol);
       
    45 	static TIkeV2TrafficSelector IdentityToSelectorL(const TDesC8& aIdentity, TUint8 aProtocol=0);
       
    46 	static TBool GetRangeEndAddresses(TInetAddr& aStartAddr, TInetAddr& aEndAddr, TInt aPrefixLen);
       
    47 	static TBool ValidataTs(const CArrayFix<TIkeV2TrafficSelector>& aTsRef, 
       
    48                             const CArrayFix<TIkeV2TrafficSelector>& aTs);
       
    49 	static TBool CheckPorts(TUint16 aStartRef, TUint16 aEndRef, TUint16 aStart, TUint16 aEnd );
       
    50 	static TBool CheckAddresses(TUint8 aType, TUint8* aRefAddresses, TUint8* aAddresses );
       
    51 	
       
    52 };
       
    53 	
       
    54 #endif