|
1 /* |
|
2 * Copyright (c) 2009-2010 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: NAT/Firewall handler for VoIP XML processor |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef VOIPXMLNATFWHANDLER_H |
|
20 #define VOIPXMLNATFWHANDLER_H |
|
21 |
|
22 #include "voipxmlprocessordefaults.h" |
|
23 |
|
24 struct TAdditionalStun |
|
25 { |
|
26 //public: |
|
27 |
|
28 /** |
|
29 * STUN server address. |
|
30 */ |
|
31 TBuf8<KMaxNodeValueLength> iStunSrvAddr; |
|
32 |
|
33 /** |
|
34 * STUN server port. |
|
35 */ |
|
36 TInt iStunSrvPort; |
|
37 |
|
38 /** |
|
39 * STUN server username. |
|
40 */ |
|
41 TBuf8<KMaxNodeValueLength> iStunSrvUsername; |
|
42 |
|
43 /** |
|
44 * STUN server password. |
|
45 */ |
|
46 TBuf8<KMaxNodeValueLength> iStunSrvPassword; |
|
47 }; |
|
48 |
|
49 /** |
|
50 * VoipXmlNatFwHandler |
|
51 * NAT/Framwrork handler class. |
|
52 * |
|
53 * @lib voipxmlprocessor.lib |
|
54 * @since S60 v5.0 |
|
55 */ |
|
56 class CVoipXmlNatFwHandler : public CBase |
|
57 { |
|
58 #ifdef _DEBUG |
|
59 friend class UT_CVoipXmlNatFwHandler; |
|
60 friend class UT_CVoipXmlParamHandler; |
|
61 #endif |
|
62 |
|
63 public: |
|
64 |
|
65 static CVoipXmlNatFwHandler* NewL(); |
|
66 ~CVoipXmlNatFwHandler(); |
|
67 |
|
68 public: |
|
69 |
|
70 /** |
|
71 * Sets NAT/Firewall setting. |
|
72 * |
|
73 * @since S60 v5.0 |
|
74 * @param aParam Parameter to be set. |
|
75 * @param aValue Value of the setting. |
|
76 */ |
|
77 void SetSetting( TInt aType, TInt aParam, const TDesC8& aValue ); |
|
78 |
|
79 /** |
|
80 * Stores settings to Central Repository (actually calls StoreSettingsL). |
|
81 * |
|
82 * @since S60 v5.0 |
|
83 * @return KErrNone if successful, |
|
84 * KErrNotSupported if no settings to be stored, |
|
85 * KErrCompletion if settings could not be stored. |
|
86 */ |
|
87 TInt StoreSettings(); |
|
88 |
|
89 /** |
|
90 * Method to inform the handler that currently deployed settings |
|
91 * have ended. This way we will know when iCurrentAdditionalStunServer |
|
92 * server should be appended to iAdditionalStunServers array. |
|
93 * |
|
94 * @since S60 v5.0 |
|
95 * @param aType Type of settings. |
|
96 */ |
|
97 void SettingsEnd( TInt aType ); |
|
98 |
|
99 private: |
|
100 |
|
101 /** |
|
102 * Commits actual Central Repository storage. |
|
103 * |
|
104 * @since S60 v5.0 |
|
105 */ |
|
106 void StoreSettingsL(); |
|
107 |
|
108 private: |
|
109 |
|
110 CVoipXmlNatFwHandler(); |
|
111 void ConstructL(); |
|
112 |
|
113 private: |
|
114 |
|
115 /** |
|
116 * Tells if any settings have been set to internal members. |
|
117 */ |
|
118 TBool iSettingsSet; |
|
119 |
|
120 /** |
|
121 * Domain name. |
|
122 * Own. |
|
123 */ |
|
124 HBufC8* iDomain; |
|
125 |
|
126 /** |
|
127 * STUN server address. |
|
128 * Own. |
|
129 */ |
|
130 HBufC8* iStunSrvAddr; |
|
131 |
|
132 /** |
|
133 * STUN server port. |
|
134 */ |
|
135 TInt iStunSrvPort; |
|
136 |
|
137 /** |
|
138 * TCP refresh interval. |
|
139 */ |
|
140 TInt iTcpRefreshInterval; |
|
141 |
|
142 /** |
|
143 * UDP refresh interval. |
|
144 */ |
|
145 TInt iUdpRefreshInterval; |
|
146 |
|
147 /** |
|
148 * CRLF refresh. |
|
149 */ |
|
150 TInt iCrlfRefresh; |
|
151 |
|
152 /** |
|
153 * STUN server username. |
|
154 * Own. |
|
155 */ |
|
156 HBufC8* iStunSrvUsername; |
|
157 |
|
158 /** |
|
159 * STUN server password. |
|
160 * Own. |
|
161 */ |
|
162 HBufC8* iStunSrvPassword; |
|
163 |
|
164 /** |
|
165 * STUN shared secret. |
|
166 */ |
|
167 TInt iStunSharedSecret; |
|
168 |
|
169 /** |
|
170 * Start port of STUN port range. |
|
171 */ |
|
172 TInt iStartPortRange; |
|
173 |
|
174 /** |
|
175 * End port of STUN port range. |
|
176 */ |
|
177 TInt iEndPortRange; |
|
178 |
|
179 /** |
|
180 * NAT protocol |
|
181 * Own. |
|
182 */ |
|
183 HBufC8* iNatProtocol; |
|
184 |
|
185 /** |
|
186 * Additional STUN server data that is being currently modified. |
|
187 * After modifications are done, it is appended to iAdditionalStunServers. |
|
188 */ |
|
189 TAdditionalStun iCurrentAdditionalStunServer; |
|
190 |
|
191 /** |
|
192 * Array for holding additional STUN server data. |
|
193 */ |
|
194 RPointerArray<TAdditionalStun> iAdditionalStunServers; |
|
195 }; |
|
196 |
|
197 #endif // VOIPXMLNATFWHANDLER_H |
|
198 |
|
199 // End of file. |