|
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 M_STUNTRANSACTIONOBSERVER_H |
|
22 #define M_STUNTRANSACTIONOBSERVER_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32def.h> |
|
26 #include <in_sock.h> |
|
27 #include "tstuncallbackinfo.h" |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CNATFWUNSAFUnknownAttributesAttribute; |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 /** |
|
35 * Defines the callbacks used by CSTUNTransaction. |
|
36 */ |
|
37 class MSTUNTransactionObserver |
|
38 { |
|
39 public: |
|
40 /** |
|
41 * Destructor |
|
42 */ |
|
43 virtual ~MSTUNTransactionObserver() {} |
|
44 |
|
45 /** |
|
46 * Transaction has terminated successfully and a public address has been |
|
47 * received. |
|
48 * TransactionError will only be called after PublicAddressObtainedL, if |
|
49 * PublicAddressObtainedL leaves. |
|
50 * |
|
51 * NOTE: If this function leaves, the associated CSTUNTransaction must NOT |
|
52 * have been deleted, since it will call TransactionError! |
|
53 * |
|
54 * @param aAddress Public address |
|
55 */ |
|
56 virtual void PublicAddressObtainedL( const TInetAddr& aAddress ) = 0; |
|
57 |
|
58 /** |
|
59 * Transaction has terminated successfully and a public address has been |
|
60 * received. |
|
61 * TransactionError will only be called after PublicAddressObtainedL, if |
|
62 * PublicAddressObtainedL leaves. |
|
63 * |
|
64 * NOTE: If this function leaves, the associated CSTUNTransaction must NOT |
|
65 * have been deleted, since it will call TransactionError! |
|
66 * |
|
67 * @param aReflexiveAddr Public server reflexive IP address |
|
68 * @param aRelayAddr Public stun server relay IP address |
|
69 */ |
|
70 virtual void PublicAddressObtainedL( const TInetAddr& aReflexiveAddr, |
|
71 const TInetAddr& aRelayAddr ) = 0; |
|
72 |
|
73 /** |
|
74 * Transaction terminated abnormally, or leave occurred from |
|
75 * MSTUNTransactionObserver::PublicAddressObtainedL. If STUN server sent a |
|
76 * Binding Error Response with response code 420 and UNKNOWN-ATTRIBUTES, |
|
77 * the UNKNOWN-ATTRIBUTES is also passed as parameter. |
|
78 * @pre aError != KErrNone |
|
79 * @param aError Error reason |
|
80 * @param aUnknownAttr UNKNOWN-ATTRIBUTES attribute, can be NULL. |
|
81 * Ownership is transferred. |
|
82 */ |
|
83 virtual void TransactionError( TInt aError, |
|
84 CNATFWUNSAFUnknownAttributesAttribute* aUnknownAttr ) = 0; |
|
85 |
|
86 /** |
|
87 * Notifies about transaction events |
|
88 * |
|
89 * @since s60 3.2 |
|
90 * @param aEvent Enumerated transaction event |
|
91 * @return void |
|
92 */ |
|
93 virtual void TransactionEventOccurredL( |
|
94 TSTUNCallbackInfo::TFunction aEvent ) = 0; |
|
95 |
|
96 /** |
|
97 * Notifies about new RTT ( Round-Trip Time ) sample is measured. If segment is retransmitted |
|
98 * then backed-off RTO value is given in param. |
|
99 * |
|
100 * @since s60 3.2 |
|
101 * @param aRttSample The new RTT sample that was measured |
|
102 * @param aRetransmitted Indicates whether last segment retransmitted |
|
103 * @return void |
|
104 */ |
|
105 virtual void NewRTTSampleMeasured( TInt64& aRTTSample, |
|
106 TBool aRetransmitted ) = 0; |
|
107 }; |
|
108 |
|
109 #endif // M_STUNTRANSACTIONOBSERVER_H |