|
1 /* |
|
2 * Copyright (c) 2005-2007 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: IKEv1 keep alive object |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_IKEV1KEEPALIVE_H |
|
20 #define C_IKEV1KEEPALIVE_H |
|
21 |
|
22 #include <in_sock.h> // TInetAddr |
|
23 |
|
24 class CIkev1PluginSession; |
|
25 class CEchoSender; |
|
26 |
|
27 /** |
|
28 * IKE keepalive event handler |
|
29 * @internalComponent |
|
30 */ |
|
31 class MDpdHeartBeatEventHandler |
|
32 { |
|
33 public: |
|
34 /** |
|
35 * IKE PKI service operation completed |
|
36 * @internalComponent |
|
37 * @param aStatus completion status of operation |
|
38 * @param aObject pointer to CIkePkiService object |
|
39 * |
|
40 */ |
|
41 virtual void EventHandlerL()=0; |
|
42 }; |
|
43 |
|
44 |
|
45 NONSHARABLE_CLASS(CIkeV1KeepAlive) : public CTimer |
|
46 { |
|
47 public: |
|
48 static CIkeV1KeepAlive* NewL( CIkev1PluginSession& aPluginSession, |
|
49 TInt aPort, |
|
50 TInetAddr& aDestAddr, |
|
51 TInt NatKeepAlive, |
|
52 TInt DpdKeepAlive, |
|
53 MDpdHeartBeatEventHandler* aHandler, |
|
54 TUint8 aDscp = 0 ); |
|
55 ~CIkeV1KeepAlive(); |
|
56 |
|
57 protected: |
|
58 // |
|
59 // CActive methods |
|
60 // |
|
61 void DoCancel(); |
|
62 void RunL(); |
|
63 TInt RunError(TInt aError); |
|
64 |
|
65 private: // implementation |
|
66 CIkeV1KeepAlive( CIkev1PluginSession& aPluginSession, |
|
67 TInt aPort, |
|
68 TInetAddr& aDestAddr, |
|
69 TInt NatKeepAlive, |
|
70 TInt DpdKeepAlive, |
|
71 MDpdHeartBeatEventHandler* aHandler, |
|
72 TUint8 aDscp ); |
|
73 void ConstructL(); |
|
74 void StartTimer(); |
|
75 |
|
76 private: // data |
|
77 MDpdHeartBeatEventHandler* iCallback; |
|
78 CIkev1PluginSession& iPluginSession; |
|
79 |
|
80 TInt iPort; |
|
81 |
|
82 /** Data to send in keepalive packet */ |
|
83 TBuf8<1> iMsg; |
|
84 |
|
85 TInt iNatKeepAlive; |
|
86 TInt iDpdKeepAlive; |
|
87 |
|
88 TInt iCurrDPDTimeLeft; |
|
89 TInt iRemainingTime; |
|
90 |
|
91 TInetAddr iDestAddr; |
|
92 |
|
93 TUint8 iDscp; |
|
94 }; |
|
95 |
|
96 #endif // C_IKEV1KEEPALIVE_H |