|
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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef C_CSTUNBINDINGSTATE_H |
|
22 #define C_CSTUNBINDINGSTATE_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32base.h> |
|
26 #include <in_sock.h> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CBindingImplementation; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * Base class for CSTUNBinding's states. |
|
35 */ |
|
36 class CSTUNBindingState : public CBase |
|
37 { |
|
38 public: |
|
39 /** |
|
40 * Destructor |
|
41 */ |
|
42 virtual ~CSTUNBindingState(); |
|
43 |
|
44 /** |
|
45 * Shared secret is available. |
|
46 * @param aContext Binding instance who received the event |
|
47 * @param aUsername Username |
|
48 * @param aPassword Password |
|
49 */ |
|
50 virtual void |
|
51 SharedSecretObtainedL( CBindingImplementation& aContext, |
|
52 const TDesC8& aUsername, |
|
53 const TDesC8& aPassword ) const; |
|
54 |
|
55 /** |
|
56 * Transaction received a Binding Response, and there was no error. |
|
57 * @param aContext Binding instance who received the event |
|
58 * @param aPublicAddress Public address to use |
|
59 */ |
|
60 virtual void |
|
61 PublicAddressReceivedL( CBindingImplementation& aContext, |
|
62 const TInetAddr& aPublicAddress ) const; |
|
63 |
|
64 /** |
|
65 * Transaction received a Binding Response, and there was no error. |
|
66 * |
|
67 * @since s60 3.2 |
|
68 * @param aContext Binding instance who received the event |
|
69 * @param aReflexiveAddr Public address to use |
|
70 * @param aRelayAddr Stun RELAY address to use |
|
71 */ |
|
72 virtual void |
|
73 PublicAddressReceivedL( CBindingImplementation& aContext, |
|
74 const TInetAddr& aReflexiveAddr, |
|
75 const TInetAddr& aRelayAddr ) const; |
|
76 |
|
77 /** |
|
78 * Transaction ended unsuccessfully. |
|
79 * @param aContext Binding instance who received the event |
|
80 * @param aError Reason for the failure |
|
81 */ |
|
82 virtual void TransactionError( CBindingImplementation& aContext, |
|
83 TInt aError ); |
|
84 |
|
85 virtual void |
|
86 TimerExpiredL( CBindingImplementation& aContext ) const; |
|
87 |
|
88 /** |
|
89 * Refreshes the binding causing a new Binding Request to be sent to the |
|
90 * STUN server |
|
91 * @param aContext Binding instance who received the event |
|
92 */ |
|
93 virtual void SendRequestL( CBindingImplementation& aContext ) const; |
|
94 |
|
95 |
|
96 /** |
|
97 * Cancels a previously issued call to SendRequestL or AllocateRequestL. |
|
98 */ |
|
99 virtual void |
|
100 CancelRequest( CBindingImplementation& aContext ) const; |
|
101 |
|
102 protected: |
|
103 |
|
104 CSTUNBindingState(); |
|
105 |
|
106 private: |
|
107 |
|
108 CSTUNBindingState( const CSTUNBindingState& aState ); |
|
109 }; |
|
110 |
|
111 #endif // C_CSTUNBINDINGSTATE_H |