|
1 /* |
|
2 * Copyright (c) 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: IKEv2 IKE message send que. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef IKEV2MESSAGESENDQUEUE_H_ |
|
19 #define IKEV2MESSAGESENDQUEUE_H_ |
|
20 |
|
21 #include <e32base.h> |
|
22 #include <in_sock.h> |
|
23 #include "ikev2sender.h" |
|
24 |
|
25 |
|
26 class MIkeDataInterface; |
|
27 class MIkeDebug; |
|
28 |
|
29 class TIkeMsgWaitQueueObject |
|
30 { |
|
31 public: |
|
32 TPtrC8 iIkeMsg; |
|
33 TBool iFloatedPort; |
|
34 }; |
|
35 |
|
36 |
|
37 NONSHARABLE_CLASS(CIkev2MessageSendQueue) : public CActive, |
|
38 public MIkev2SenderCallback |
|
39 { |
|
40 public: |
|
41 static CIkev2MessageSendQueue* NewL(MIkeDataInterface& aDataInterface, |
|
42 const TInetAddr& aDestinationAddress, |
|
43 TUint8 aDscp, |
|
44 TUint aNatKeepAliveInterval, |
|
45 MIkeDebug& aDebug); |
|
46 ~CIkev2MessageSendQueue(); |
|
47 |
|
48 void SendIkeMessageL(const TPtrC8 aIkeMsg, TBool aFloatedPort); |
|
49 void CancelSend(const TPtrC8& aIkeMsg); |
|
50 |
|
51 void CancelAll(); |
|
52 |
|
53 void NewSaBehindNatL(TUint aSaId); |
|
54 void SaBehindNatDeleted(TUint aSaId); |
|
55 |
|
56 protected: |
|
57 void SendIkeMsgCompleted( TInt aStatus ); |
|
58 |
|
59 void RunL(); |
|
60 void DoCancel(); |
|
61 |
|
62 private: |
|
63 CIkev2MessageSendQueue(MIkeDataInterface& aDataInterface, |
|
64 const TInetAddr& aDestinationAddress, |
|
65 TUint8 aDscp, |
|
66 TUint aNatKeepAliveInterval, |
|
67 MIkeDebug& aDebug); |
|
68 void ConstructL(); |
|
69 void ArmKeepaliveTimer(); |
|
70 |
|
71 MIkeDataInterface& iDataInterface; |
|
72 TUint iNatKeepAliveInterval; |
|
73 TInetAddr iDestinationAddress; |
|
74 TUint8 iDscp; |
|
75 MIkeDebug& iDebug; |
|
76 |
|
77 CIkev2Sender* iSender; |
|
78 RTimer iNatKeepaliveTimer; |
|
79 |
|
80 RArray<TIkeMsgWaitQueueObject> iIkeMsgSendBuffer; //IkeMsgs waiting for send |
|
81 TPtrC8 iIkeMsgInSending; //IkeMsgs, which is currently in sending |
|
82 |
|
83 RArray<TUint> iSasBehindNat; |
|
84 TUint iRemainingTime; |
|
85 }; |
|
86 |
|
87 #endif /* IKEV2MESSAGESENDQUEUE_H_ */ |