|
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: Defines all necessary constants used in STUN Client |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef NATFWSTUNCLIENTDEFS_H |
|
22 #define NATFWSTUNCLIENTDEFS_H |
|
23 |
|
24 #include <e32std.h> |
|
25 |
|
26 _LIT8( KStun, "stun" ); |
|
27 _LIT8( KStunRelay, "stun-relay" ); |
|
28 const TInt KErrNATFWDnsFailure = -27000; |
|
29 |
|
30 /** Transport protocols */ |
|
31 enum TTransportProtocol |
|
32 { |
|
33 EUndefinedTransportProtocol = 0, |
|
34 ETcpProtocol, |
|
35 EUdpProtocol |
|
36 }; |
|
37 |
|
38 /** Known STUN error codes */ |
|
39 enum TTransactionError |
|
40 { |
|
41 E1XX = 100, |
|
42 E300TryAlternate = 300, |
|
43 E4XX = 400, |
|
44 E401Unauthorized = 401, |
|
45 |
|
46 // Server rejected request because it contained unknown attributes |
|
47 E420UnknownAttributes = 420, |
|
48 |
|
49 E430StaleCredentials = 430, // removed from stunrfc3489bis-08 |
|
50 E431IntegrityCheckFailure = 431, // removed from stunrfc3489bis-08 |
|
51 E432MissingUsername = 432, // removed from stunrfc3489bis-08 |
|
52 E433UseTLS = 433, // removed from stunrfc3489bis-08 |
|
53 E434MissingRealm = 434, // removed from stunrfc3489bis-08 |
|
54 E435MissingNonce = 435, // removed from stunrfc3489bis-08 |
|
55 E436UnknownUsername = 436, // removed from stunrfc3489bis-08 |
|
56 E438StaleNonce = 438, |
|
57 |
|
58 // draft-ietf-behave-turn-02 defines new error codes |
|
59 E437NoBindind = 437, |
|
60 E439Transitioning = 439, |
|
61 E442UnsupportedTransportProtocol = 442, |
|
62 E443InvalidIPAddress = 443, |
|
63 E444InvalidPort = 444, |
|
64 E445OperationForTCPOnly = 445, |
|
65 E446ConnectionAlreadyExists = 446, |
|
66 E486AllocationQuotaReached = 486, |
|
67 E487RoleConflict = 487, |
|
68 |
|
69 E500ServerError = 500, |
|
70 E507InsufficientCapacity = 507, |
|
71 E600GlobalFailure = 600, // removed from stunrfc3489bis-08 |
|
72 |
|
73 // Request should be retried after adding XOR-ONLY attribute |
|
74 ERetryAfterAddingXorOnly = 1001 |
|
75 }; |
|
76 |
|
77 |
|
78 /** ICE specific attributes */ |
|
79 class TICEAttributes |
|
80 { |
|
81 public: |
|
82 |
|
83 inline TICEAttributes( ) : |
|
84 iPriority( 0 ), |
|
85 iUseCandidate( EFalse ), |
|
86 iControlled( 0 ), |
|
87 iControlling( 0 ) |
|
88 { |
|
89 } |
|
90 |
|
91 inline TICEAttributes( TUint aPriority, |
|
92 TBool aUseCandidate, |
|
93 TUint64 aControlled, |
|
94 TUint64 aControlling ) : |
|
95 iPriority( aPriority ), |
|
96 iUseCandidate( aUseCandidate ), |
|
97 iControlled( aControlled ), |
|
98 iControlling( aControlling ) |
|
99 { |
|
100 } |
|
101 |
|
102 public: |
|
103 /** |
|
104 * Priority. Set to "0" if not used. |
|
105 */ |
|
106 TUint iPriority; |
|
107 |
|
108 /** |
|
109 * Use candidate flag. If attribute not needed, set to "EFalse" |
|
110 */ |
|
111 TBool iUseCandidate; |
|
112 |
|
113 /** |
|
114 * Controlled. If value is greater than "0", |
|
115 * attribute is added to request. |
|
116 */ |
|
117 TUint64 iControlled; |
|
118 |
|
119 /** |
|
120 * Controlling. If value is greater than "0", |
|
121 * attribute is added to request. |
|
122 */ |
|
123 TUint64 iControlling; |
|
124 }; |
|
125 |
|
126 #endif // NATFWSTUNCLIENTDEFS_H |