|
1 /* |
|
2 * Copyright (c) 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: Transmit indications to sender |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef C_STUNINDICATIONTRANSMITTER_H |
|
22 #define C_STUNINDICATIONTRANSMITTER_H |
|
23 |
|
24 |
|
25 #include <e32base.h> |
|
26 #include <in_sock.h> |
|
27 #include "cnatfwunsafmediaconnsender.h" |
|
28 #include "mncmsenderobserver.h" |
|
29 #include "cnatfwunsaftcprelaypacketsender.h" |
|
30 |
|
31 |
|
32 class CNATFWUNSAFMessage; |
|
33 class CNATFWUNSAFBindingRequest; |
|
34 class MNcmConnectionMultiplexer; |
|
35 |
|
36 |
|
37 /** |
|
38 * Class for transmitting indications to multiplexer. |
|
39 * Multiplexer acts as sender, meaning it will send indications |
|
40 * eventually to network . |
|
41 * |
|
42 * @lib natfwstunclient.lib |
|
43 * @since S60 v3.2 |
|
44 */ |
|
45 |
|
46 class CStunIndicationTransmitter : public CBase |
|
47 { |
|
48 public: |
|
49 |
|
50 /** |
|
51 * Two-phased constructor. |
|
52 * @param aMux multiplexer |
|
53 * @param aStreamId stream identifier |
|
54 * @param aConnectionId connection identifier |
|
55 */ |
|
56 static CStunIndicationTransmitter* NewL( MNcmConnectionMultiplexer& aMux, |
|
57 TUint aStreamId, |
|
58 TUint aConnectionId ); |
|
59 |
|
60 /** |
|
61 * Destructor. |
|
62 */ |
|
63 virtual ~CStunIndicationTransmitter(); |
|
64 |
|
65 /** |
|
66 * Transmits indication to multiplexer's send queue. |
|
67 * |
|
68 * @since S60 v3.2 |
|
69 * @param aIndication indication to send |
|
70 * @return void |
|
71 */ |
|
72 void TransmitL( CNATFWUNSAFMessage& aIndication ); |
|
73 |
|
74 /** |
|
75 * Transmits indication to multiplexer's send queue. |
|
76 * |
|
77 * @since S60 v3.2 |
|
78 * @param aIndication indication to send |
|
79 * @param aAddress address to send to (destination) |
|
80 * @param aSharedSecret shared secret |
|
81 * optional - added if authentication needed |
|
82 * @param aAddFingerprint fingerprint; added or not |
|
83 * optional - by default EFalse |
|
84 * @return void |
|
85 */ |
|
86 void TransmitL( CNATFWUNSAFMessage& aIndication, |
|
87 const TInetAddr& aAddress, |
|
88 const TDesC8& aSharedSecret=KNullDesC8(), |
|
89 TBool aAddFingerprint=EFalse ); |
|
90 |
|
91 /** |
|
92 * Transmits indication to multiplexer's send queue by using TCP relay |
|
93 * packet sender. |
|
94 * |
|
95 * @since S60 v3.2 |
|
96 * @param aMessage TCP relay message |
|
97 * @return void |
|
98 */ |
|
99 void TransmitL( const CNATFWUNSAFTcpRelayPacket& aMessage ); |
|
100 |
|
101 private: |
|
102 |
|
103 CStunIndicationTransmitter(); |
|
104 |
|
105 CStunIndicationTransmitter( MNcmConnectionMultiplexer& aMux, |
|
106 TUint aStreamId, |
|
107 TUint aConnectionId ); |
|
108 |
|
109 void ConstructL(); |
|
110 |
|
111 |
|
112 private: // data |
|
113 |
|
114 /** |
|
115 * multiplexer |
|
116 * not own. |
|
117 */ |
|
118 MNcmConnectionMultiplexer& iMux; |
|
119 |
|
120 /** |
|
121 * stream identifier |
|
122 */ |
|
123 TUint iStreamId; |
|
124 |
|
125 /** |
|
126 * connection identifier |
|
127 */ |
|
128 TUint iConnectionId; |
|
129 |
|
130 /** |
|
131 * media connection sender |
|
132 * own. |
|
133 */ |
|
134 CNATFWUNSAFMediaConnSender* iSender; |
|
135 |
|
136 /** |
|
137 * TCP relay packet sender |
|
138 * Own. |
|
139 */ |
|
140 CNATFWUNSAFTcpRelayPacketSender* iTcpRelaySender; |
|
141 }; |
|
142 |
|
143 |
|
144 #endif // C_STUNINDICATIONTRANSMITTER_H |