Update contrib.
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
26 #include <caf/streaming/keystreamsink.h>
27 #include <caf/streaming/keyassociation.h>
30 #include <lib_pfkey.h>
31 #include <pfkey_send.h>
32 #include <ipsecpolapi.h>
34 #ifndef __IPSECKEYSTREAMSINK_H__
35 #define __IPSECKEYSTREAMSINK_H__
39 namespace StreamAccess
41 NONSHARABLE_CLASS(CIpSecKeyStreamSink) : public CKeyStreamSink
44 static CIpSecKeyStreamSink* NewLC(RReadStream& aReadStream);
45 static CIpSecKeyStreamSink* NewLC(const TInetAddr& aSrcAddr, const TInetAddr& aDstAddr);
46 ~CIpSecKeyStreamSink();
48 // CKeyStreamSink interface
49 CKeyStreamSink* CloneLC() const;
50 void ProcessNewKeyAssociationL(const CKeyAssociation& aKeyAssociation);
51 void SetEncryptionAlgorithmL(const TEncryptionAlgorithm& aEncryptionAlgorithm);
52 void SetAuthenticationAlgorithmL(const TAuthenticationAlgorithm& aAuthenticationAlgorithm);
54 void DoExternalizeL(RWriteStream& aStream) const;
58 void RemoveSaL(TUint32 aSpi);
59 void SynchronousSendAndVerifyMessageL(TPfkeySendMsg& aMessage, TInt aMessageType, TUint32 aSpi);
60 TBool CompareReceivedMessageExtensionsL(TPfkeyRecvMsg &aReceivedReply, TUint32 aSpi) const;
61 void VerifyAssociationsNotSentL() const;
62 CIpSecKeyStreamSink(const TInetAddr& aSrcAddr, const TInetAddr& aDstAddr);
63 void AddAssociationL(TPfkeySendMsg& aMessage, TUint32 aSpi);
65 RSocketServ iSocketServ;
66 /** Handle to policy server */
67 RIpsecPolicyServ iPolicyServer;
68 /** Handle to SADB socket */
70 TInetAddr iSourceAddr;
71 TInetAddr iDestinationAddr;
74 TUint32 iSequenceNumber;
75 /** Signifies whether a security policy has already been set */
77 TPolicyHandlePckg iPolicyHandle;
78 /** Used for removing old SA-s, managed as a FIFO queue */
79 RArray<TUint32> iSubmittedSpiList;
80 /** Number of supported concurrent SA-s */
83 } // namespace StreamAccess
84 #endif /* __IPSECKEYSTREAMSINK_H__ */