|
1 /* |
|
2 * Copyright (c) 2006 - 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: NAT-FW Traversal domain specific settings |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDES |
|
20 #include <e32base.h> |
|
21 |
|
22 class CRepository; |
|
23 class CWPStunServerItem; |
|
24 class CWPTurnServerItem; |
|
25 |
|
26 /** |
|
27 * Buffer class for domain specific settings in NAT/FW Traversal adapter |
|
28 * @since S60 v3.1 |
|
29 */ |
|
30 class CNATFWDomainSpecificItem : public CBase |
|
31 { |
|
32 public: // Constructors and destructor |
|
33 /** |
|
34 * Two-phased constructor. |
|
35 */ |
|
36 static CNATFWDomainSpecificItem* NewL(); |
|
37 static CNATFWDomainSpecificItem* NewLC(); |
|
38 |
|
39 /** |
|
40 * Destructor. |
|
41 */ |
|
42 virtual ~CNATFWDomainSpecificItem(); |
|
43 |
|
44 public: // New methods |
|
45 |
|
46 /** |
|
47 * Return profile id. |
|
48 * @since Series 60 3.0. |
|
49 * @return Id of the NATFW domain item. |
|
50 */ |
|
51 const TDesC8& SaveData() const; |
|
52 |
|
53 /** |
|
54 * Setter for DomainKey. |
|
55 * @since Series 60_3.1 |
|
56 * @param aDomainKey value to set. Key for domain table in CenRep. |
|
57 */ |
|
58 void SetDomainKey( TUint32 aDomainKey ); |
|
59 |
|
60 /** |
|
61 * Setter for Domain. |
|
62 * @since Series 60_3.1 |
|
63 * @param aDomain value to set. |
|
64 */ |
|
65 void SetDomainL( const TDesC8& aDomain ); |
|
66 |
|
67 /** |
|
68 * Setter for STUNServerAddr. |
|
69 * @since Series 60_3.1 |
|
70 * @param aSTUNServerAddr value to set. |
|
71 */ |
|
72 void SetSTUNServerAddrL( const TDesC8& aSTUNServerAddr ); |
|
73 |
|
74 /** |
|
75 * Setter for STUNServerPort. |
|
76 * @since Series 60_3.1 |
|
77 * @param aSTUNServerPort value to set. |
|
78 */ |
|
79 void SetSTUNServerPort( TUint aSTUNServerPort ); |
|
80 |
|
81 /** |
|
82 * Setter for NATRefreshTCP. |
|
83 * @since Series 60_3.1 |
|
84 * @param aNATRefreshTCP value to set. |
|
85 */ |
|
86 void SetNATRefreshTCP( TInt aNATRefreshTCP ); |
|
87 |
|
88 /** |
|
89 * Setter for NATRefreshUDP. |
|
90 * @since Series 60_3.1 |
|
91 * @param aNATRefreshUDP value to set. |
|
92 */ |
|
93 void SetNATRefreshUDP( TInt aNATRefreshUDP ); |
|
94 |
|
95 /** |
|
96 * Setter for CRLFRefresh. |
|
97 * @since Series 60_3.1 |
|
98 * @param aEnableCRLFRefresh value to set. |
|
99 */ |
|
100 void SetEnableCRLFRefresh( TInt aEnableCRLFRefresh ); |
|
101 |
|
102 /** |
|
103 * Set default domain specific setting values. |
|
104 * @since S60 3.2 |
|
105 */ |
|
106 void SetDefaultValuesL(); |
|
107 |
|
108 /** |
|
109 * Setter for STUNUsername. |
|
110 * @since S60 3.2 |
|
111 * @param aSTUNUsername value to set. |
|
112 */ |
|
113 void SetSTUNUsernameL( const TDesC8& aSTUNUsername ); |
|
114 |
|
115 /** |
|
116 * Setter for STUNPassword. |
|
117 * @since S60 3.2 |
|
118 * @param aSTUNPassword value to set. |
|
119 */ |
|
120 void SetSTUNPasswordL( const TDesC8& aSTUNPassword ); |
|
121 |
|
122 /** |
|
123 * Setter for DisableStunSharedSecret. |
|
124 * @since S60 3.2 |
|
125 * @param aStunSharedSecret Value to be set. |
|
126 */ |
|
127 void SetDisableStunSharedSecret( |
|
128 const TBool aDisableStunSharedSecret ); |
|
129 |
|
130 /** |
|
131 * Setter for StartPortRange. |
|
132 * @since S60 3.2 |
|
133 * @param aPortPoolStart value to set. |
|
134 */ |
|
135 void SetStartPortRange( TInt aStartPortRange ); |
|
136 |
|
137 /** |
|
138 * Setter for EndPortRange. |
|
139 * @since S60 3.2 |
|
140 * @param aPortPoolEnd value to set. |
|
141 */ |
|
142 void SetEndPortRange( TInt aEndPortRange ); |
|
143 |
|
144 /** |
|
145 * Setter for UsedNATProtocol. |
|
146 * @since S60 3.2 |
|
147 * @param aNatProtocol value to set. |
|
148 */ |
|
149 void SetNatProtocolL( const TDesC8& aNatProtocol ); |
|
150 |
|
151 /** |
|
152 * ICE: Setter for NatUtilities. |
|
153 * @since S60 3.2 |
|
154 * @param aNatUtilities NAT utilities to be set. |
|
155 */ |
|
156 void SetNatUtilitiesL( const TDesC8& aNatUtilities ); |
|
157 |
|
158 /** |
|
159 * ICE: Setter for HostPreference. |
|
160 * @since S60 3.2 |
|
161 * @param aHostPref HostPreference value to be set. |
|
162 */ |
|
163 void SetHostPref( TInt aHostPref ); |
|
164 |
|
165 /** |
|
166 * ICE: Setter for ServerReflexivePreference. |
|
167 * @since S60 3.2 |
|
168 * @param aServerRefPref Preference value to be set. |
|
169 */ |
|
170 void SetServerRefPref( TInt aServerRefPref ); |
|
171 |
|
172 /** |
|
173 * ICE: Setter for RelayPreference. |
|
174 * @since S60 3.2 |
|
175 * @param aRelayPref Preference value to be set. |
|
176 */ |
|
177 void SetRelayPref( TInt aRelayPref ); |
|
178 |
|
179 /** |
|
180 * ICE: Setter for PeerReflexivePreference. |
|
181 * @since S60 3.2 |
|
182 * @param aPeerRefPref Preference value to be set. |
|
183 */ |
|
184 void SetPeerRefPref( TInt aPeerRefPref ); |
|
185 |
|
186 /** |
|
187 * ICE: Setter for IPv4Preference. |
|
188 * @since S60 3.2 |
|
189 * @param aIPv4Pref Preference value to be set. |
|
190 */ |
|
191 void SetIPv4Pref( TInt aIPv4Pref ); |
|
192 |
|
193 /** |
|
194 * ICE: Setter for IPv6Preference. |
|
195 * @since S60 3.2 |
|
196 * @param aIPv6Pref Preference value to be set. |
|
197 */ |
|
198 void SetIPv6Pref( TInt aIPv6Pref ); |
|
199 |
|
200 /** |
|
201 * ICE: Setter for VPNPreference. |
|
202 * @since S60 3.2 |
|
203 * @param aVPNPref Preference value to be set. |
|
204 */ |
|
205 void SetVpnPref( TInt aVPNPref ); |
|
206 |
|
207 /** |
|
208 * ICE: Setter for UDPPreference. |
|
209 * @since S60 3.2 |
|
210 * @param aUDPPref Preference value to be set. |
|
211 */ |
|
212 void SetUdpPref( TInt aUDPPref ); |
|
213 |
|
214 /** |
|
215 * ICE: Setter for TCPPreference. |
|
216 * @since S60 3.2 |
|
217 * @param aTCPPref Preference value to be set. |
|
218 */ |
|
219 void SetTcpPref( TInt aTCPPref ); |
|
220 |
|
221 /** |
|
222 * ICE: Setter for TCPActivePreference. |
|
223 * @since S60 3.2 |
|
224 * @param aTCPActivePref Preference value to be set. |
|
225 */ |
|
226 void SetTcpActivePref( TInt aTCPActivePref ); |
|
227 |
|
228 /** |
|
229 * ICE: Setter for TCPPassivePreference. |
|
230 * @since S60 3.2 |
|
231 * @param aTCPPassivePref Preference value to be set. |
|
232 */ |
|
233 void SetTcpPassivePref( TInt aTCPPassivePref ); |
|
234 |
|
235 /** |
|
236 * ICE: Setter for TCPSimultaneousOpenPreference. |
|
237 * @since S60 3.2 |
|
238 * @param aTCPSimultPref Preference value to be set. |
|
239 */ |
|
240 void SetTcpSimultPref( TInt aTCPSimultPref ); |
|
241 |
|
242 /** |
|
243 * Add a STUN server item. |
|
244 * |
|
245 * @since S60 v3.2 |
|
246 * @param aStunServerItem STUN server item. |
|
247 */ |
|
248 void AddStunServerItemL( CWPStunServerItem* aStunServerItem ); |
|
249 |
|
250 /** |
|
251 * Add a TURN server item. |
|
252 * |
|
253 * @since S60 v3.2 |
|
254 * @param aStunServerItem STUN server item. |
|
255 */ |
|
256 void AddTurnServerItemL( CWPTurnServerItem* aTurnServerItem ); |
|
257 |
|
258 /** |
|
259 * Getter for DomainKey. |
|
260 * @since Series 60_3.1 |
|
261 * @return Key for domain table in CenRep. |
|
262 */ |
|
263 TUint32 GetDomainKey() const; |
|
264 |
|
265 /** |
|
266 * Getter for Domain. |
|
267 * @since Series 60_3.1 |
|
268 * @return Domain value |
|
269 */ |
|
270 const TDesC8& GetDomain() const; |
|
271 |
|
272 /** |
|
273 * Getter for STUNServerAddr. |
|
274 * @since Series 60_3.1 |
|
275 * @return Stun server address value |
|
276 */ |
|
277 const TDesC8& GetSTUNAddr() const; |
|
278 |
|
279 /** |
|
280 * Getter for STUNServerPort. |
|
281 * @since Series 60_3.1 |
|
282 * @return Stun server port value |
|
283 */ |
|
284 TUint GetSTUNPort() const; |
|
285 |
|
286 /** |
|
287 * Getter for NATRefreshTCP. |
|
288 * @since Series 60_3.1 |
|
289 * @return NAT refresh for tcp value |
|
290 */ |
|
291 TInt GetNATRefreshTCP() const; |
|
292 |
|
293 /** |
|
294 * Getter for NATRefreshUDP. |
|
295 * @since Series 60_3.1 |
|
296 * @return NAT refresh for udp value |
|
297 */ |
|
298 TInt GetNATRefreshUDP() const; |
|
299 |
|
300 /** |
|
301 * Getter for CRLFRefresh. |
|
302 * @since Series 60_3.1 |
|
303 * @return CRLF refresh state |
|
304 */ |
|
305 TInt GetEnableCRLFRefresh() const; |
|
306 |
|
307 /** |
|
308 * Getter for STUNUsername. |
|
309 * @since S60 3.2 |
|
310 * @return Stun server username |
|
311 */ |
|
312 const TDesC8& GetSTUNUsername() const; |
|
313 |
|
314 /** |
|
315 * Getter for STUNPassword. |
|
316 * @since S60 3.2 |
|
317 * @return Stun server password |
|
318 */ |
|
319 const TDesC8& GetSTUNPassword() const; |
|
320 |
|
321 /** |
|
322 * Getter for DisableStunSharedSecret. |
|
323 * @since S60 3.2 |
|
324 * @return Value for disabling STUN shared secret. |
|
325 */ |
|
326 TBool DisableStunSharedSecret() const; |
|
327 |
|
328 /** |
|
329 * Getter for StartPortRange. |
|
330 * @since Series 60_3.1 |
|
331 * @return Start port of port pool. |
|
332 */ |
|
333 TInt StartPortRange() const; |
|
334 |
|
335 /** |
|
336 * Getter for EndPortRange. |
|
337 * @since S60 3.2 |
|
338 * @return End port of port pool. |
|
339 */ |
|
340 TInt EndPortRange() const; |
|
341 |
|
342 /** |
|
343 * Getter for UsedNATProtocol. |
|
344 * @since S60 3.2 |
|
345 * @return Used NAT protocol. |
|
346 */ |
|
347 const TDesC8& UsedNatProtocol() const; |
|
348 |
|
349 /** |
|
350 * Getter for NatUtilities. |
|
351 * @since S60 3.2 |
|
352 * @return Used NAT utilities. |
|
353 */ |
|
354 const TDesC8& NatUtilities() const; |
|
355 |
|
356 /** |
|
357 * ICE: Getter for HostPreference. |
|
358 * @since S60 3.2 |
|
359 * @return Preference value. |
|
360 */ |
|
361 TInt HostPref() const; |
|
362 |
|
363 /** |
|
364 * ICE: Getter for ServerReflexivePreference. |
|
365 * @since S60 3.2 |
|
366 * @return Preference value. |
|
367 */ |
|
368 TInt ServerRefPref() const; |
|
369 |
|
370 /** |
|
371 * ICE: Getter for RelayPreference. |
|
372 * @since S60 3.2 |
|
373 * @return Preference value. |
|
374 */ |
|
375 TInt RelayPref() const; |
|
376 |
|
377 /** |
|
378 * ICE: Getter for PeerReflexivePreference. |
|
379 * @since S60 3.2 |
|
380 * @return Preference value. |
|
381 */ |
|
382 TInt PeerRefPref() const; |
|
383 |
|
384 /** |
|
385 * ICE: Getter for IPv4Preference. |
|
386 * @since S60 3.2 |
|
387 * @return Preference value. |
|
388 */ |
|
389 TInt IPv4Pref() const; |
|
390 |
|
391 /** |
|
392 * ICE: Getter for IPv6Preference. |
|
393 * @since S60 3.2 |
|
394 * @return Preference value. |
|
395 */ |
|
396 TInt IPv6Pref() const; |
|
397 |
|
398 /** |
|
399 * ICE: Getter for VPNPreference. |
|
400 * @since S60 3.2 |
|
401 * @return Preference value. |
|
402 */ |
|
403 TInt VpnPref() const; |
|
404 |
|
405 /** |
|
406 * ICE: Getter for UDPPreference. |
|
407 * @since S60 3.2 |
|
408 * @return Preference value. |
|
409 */ |
|
410 TInt UdpPref() const; |
|
411 |
|
412 /** |
|
413 * ICE: Getter for TCPPreference. |
|
414 * @since S60 3.2 |
|
415 * @return Preference value. |
|
416 */ |
|
417 TInt TcpPref() const; |
|
418 |
|
419 /** |
|
420 * ICE: Getter for TCPActivePreference. |
|
421 * @since S60 3.2 |
|
422 * @return Preference value. |
|
423 */ |
|
424 TInt TcpActivePref() const; |
|
425 |
|
426 /** |
|
427 * ICE: Getter for TCPPassivePreference. |
|
428 * @since S60 3.2 |
|
429 * @return Preference value. |
|
430 */ |
|
431 TInt TcpPassivePref() const; |
|
432 |
|
433 /** |
|
434 * ICE: Getter for TCPSimultaneousOpenPreference. |
|
435 * @since S60 3.2 |
|
436 * @return Preference value. |
|
437 */ |
|
438 TInt TcpSimultPref() const; |
|
439 |
|
440 /** |
|
441 * Stores STUN server items to Central Repository. |
|
442 * @since S60 3.2 |
|
443 * @param aRepository Cenral Repository object. |
|
444 * @param aKey Central Repository key used in storing. |
|
445 * @param aDomainKey Central Repository key used in finding keys. |
|
446 */ |
|
447 void StoreStunServerItemsL( CRepository* aRepository, TUint32 aKey, |
|
448 TUint32 aDomainKey ); |
|
449 |
|
450 /** |
|
451 * Stores TURN server items to Central Repository. |
|
452 * @since S60 3.2 |
|
453 * @param aRepository Cenral Repository object. |
|
454 * @param aKey Central Repository key. |
|
455 */ |
|
456 void StoreTurnServerItemsL( CRepository* aRepository, TUint32 aKey ); |
|
457 |
|
458 private: |
|
459 |
|
460 void ConstructL(); |
|
461 |
|
462 private: // Data |
|
463 |
|
464 /** |
|
465 * Identifier of the Domain. |
|
466 */ |
|
467 TUint32 iDomainKey; |
|
468 |
|
469 /** |
|
470 * Domain address. |
|
471 * Own. |
|
472 */ |
|
473 HBufC8* iDomain; |
|
474 |
|
475 /** |
|
476 * STUN server addr. |
|
477 * Own. |
|
478 */ |
|
479 HBufC8* iSTUNServerAddr; |
|
480 |
|
481 /** |
|
482 * STUN server port. |
|
483 */ |
|
484 TUint iSTUNServerPort; |
|
485 |
|
486 /** |
|
487 * NAT refresh value for TCP. |
|
488 */ |
|
489 TInt iNATRefreshTCP; |
|
490 |
|
491 /** |
|
492 * NAT refresh value for UDP. |
|
493 */ |
|
494 TInt iNATRefreshUDP; |
|
495 |
|
496 /** |
|
497 * CRLF refresh value. |
|
498 */ |
|
499 TInt iEnableCRLFRefresh; |
|
500 |
|
501 /** |
|
502 * STUN server username. |
|
503 * Own. |
|
504 */ |
|
505 HBufC8* iSTUNUsername; |
|
506 |
|
507 /** |
|
508 * STUN server password. |
|
509 * Own. |
|
510 */ |
|
511 HBufC8* iSTUNPassword; |
|
512 |
|
513 /** |
|
514 * Whether to use STUN shared secret mechanism. Parameter name: |
|
515 * STUN_SHARED_SECRET. |
|
516 * See w902E.txt for more information. |
|
517 */ |
|
518 TBool iDisableStunSharedSecret; |
|
519 |
|
520 /** |
|
521 * Start port of the port range. |
|
522 */ |
|
523 TInt iStartPortRange; |
|
524 |
|
525 /** |
|
526 * End port of the port range. |
|
527 */ |
|
528 TInt iEndPortRange; |
|
529 |
|
530 /** |
|
531 * ICE: NAT utilities to be used by ICE. |
|
532 * Parameter name: NATUTILITIES. |
|
533 * See w902E.txt for more details. |
|
534 */ |
|
535 HBufC8* iNatUtilities; |
|
536 |
|
537 /** |
|
538 * ICE: Host candidate in type preference used in ICE priorization. |
|
539 * Parameter name: HOSTPREF. |
|
540 * See w902E.txt for more details. |
|
541 */ |
|
542 TInt iHostPref; |
|
543 |
|
544 /** |
|
545 * ICE: Server reflexive candidate in type preference used in ICE |
|
546 * priorization. |
|
547 * Parameter name: SERVERREFPREF. |
|
548 * See w902E.txt for more details. |
|
549 */ |
|
550 TInt iServerRefPref; |
|
551 |
|
552 /** |
|
553 * ICE: Relay candidate in type preference used in ICE priorization. |
|
554 * Parameter name: RELAYPREF. |
|
555 * See w902E.txt for more details. |
|
556 */ |
|
557 TInt iRelayPref; |
|
558 |
|
559 /** |
|
560 * ICE: Peer reflexive candidate in type preference used in ICE |
|
561 * priorization. |
|
562 * Parameter name: PEERREFPREF. |
|
563 * See w902E.txt for more details. |
|
564 */ |
|
565 TInt iPeerRefPref; |
|
566 |
|
567 /** |
|
568 * ICE: IPv4 part in local preference used in ICE priorization. |
|
569 * Parameter name: IPV4PREF. |
|
570 * See w902E.txt for more details. |
|
571 */ |
|
572 TInt iIPv4Pref; |
|
573 |
|
574 /** |
|
575 * ICE: IPv6 part in local preference used in ICE priorization. |
|
576 * Parameter name: IPV6PREF. |
|
577 * See w902E.txt for more details. |
|
578 */ |
|
579 TInt iIPv6Pref; |
|
580 |
|
581 /** |
|
582 * ICE: VPN part in local preference used in ICE priorization. |
|
583 * Parameter name: VPNPREF. |
|
584 * See w902E.txt for more details. |
|
585 */ |
|
586 TInt iVPNPref; |
|
587 |
|
588 /** |
|
589 * ICE: The udp part in transport-pref (part of local-preference) used |
|
590 * in ICE priorization. |
|
591 * Parameter name: UDPPREF. |
|
592 * See w902E.txt for more details. |
|
593 */ |
|
594 TInt iUDPPref; |
|
595 |
|
596 /** |
|
597 * ICE: The tcp part in transport-pref (part of local-preference) used |
|
598 * in ICE priorization. |
|
599 * Parameter name: TCPPREF. |
|
600 * See w902E.txt for more details. |
|
601 */ |
|
602 TInt iTCPPref; |
|
603 |
|
604 /** |
|
605 * ICE: The tcp-active part in direction-pref (part of |
|
606 * local-preference) used in ICE priorization. |
|
607 * Parameter name: TCPACTIVEPREF. |
|
608 * See w902E.txt for more details. |
|
609 */ |
|
610 TInt iTCPActivePref; |
|
611 |
|
612 /** |
|
613 * ICE: The tcp-passive part in direction-pref (part of |
|
614 * local-preference) used in ICE priorization. |
|
615 * Parameter name: TCPPASSIVEPREF. |
|
616 * See w902E.txt for more details. |
|
617 */ |
|
618 TInt iTCPPassivePref; |
|
619 |
|
620 /** |
|
621 * ICE: The tcp-simultaneous-open part in direction-pref (part of |
|
622 * local-preference) used in ICE priorization. |
|
623 * Parameter name: TCPSIMULTPREF. |
|
624 * See w902E.txt for more details. |
|
625 */ |
|
626 TInt iTCPSimultPref; |
|
627 |
|
628 /** |
|
629 * Used NAT protocol |
|
630 * Parameter name: APROTOCOL. |
|
631 * See w902E.txt for more details. |
|
632 * Own. |
|
633 */ |
|
634 HBufC8* iUsedNatProtocol; |
|
635 |
|
636 /** |
|
637 * An array of STUN server items. |
|
638 */ |
|
639 RPointerArray<CWPStunServerItem> iStunServers; |
|
640 |
|
641 /** |
|
642 * An array of TURN server items. |
|
643 */ |
|
644 RPointerArray<CWPTurnServerItem> iTurnServers; |
|
645 |
|
646 private: // Friend class for testing |
|
647 #if defined( TEST_EUNIT ) |
|
648 friend class T_NATFWTraversalAdapter; |
|
649 #endif |
|
650 |
|
651 }; |