|
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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #include "TNATServerSettings.h" |
|
22 |
|
23 |
|
24 // ======== MEMBER FUNCTIONS ======== |
|
25 |
|
26 // --------------------------------------------------------------------------- |
|
27 // TNATServerSettings::TNATServerSettings |
|
28 // --------------------------------------------------------------------------- |
|
29 // |
|
30 EXPORT_C TNATServerSettings::TNATServerSettings( |
|
31 TUint aPort, |
|
32 TUint aTCPTimeout, |
|
33 TUint aUDPTimeout, |
|
34 TUint aConnectivityCheckTimeout, |
|
35 TBool aCRLFEnabled ) : |
|
36 iAddress( 0 ), |
|
37 iUsername( 0 ), |
|
38 iPassword( 0 ), |
|
39 iPort( aPort), |
|
40 iTCPTimeout( aTCPTimeout ), |
|
41 iUDPTimeout( aUDPTimeout ), |
|
42 iConnectivityCheckTimeout( aConnectivityCheckTimeout), |
|
43 iCRLFRefreshEnabled( aCRLFEnabled ) |
|
44 { |
|
45 } |
|
46 |
|
47 |
|
48 // --------------------------------------------------------------------------- |
|
49 // TNATServerSettings::SetAddressL |
|
50 // --------------------------------------------------------------------------- |
|
51 // |
|
52 EXPORT_C void TNATServerSettings::SetAddressL( const TDesC8& aAddress ) |
|
53 { |
|
54 __ASSERT_ALWAYS( aAddress.Length() < KNATFWMaxAddressLength, |
|
55 User::Leave( KErrOverflow ) ); |
|
56 iAddress.Copy( aAddress ); |
|
57 } |
|
58 |
|
59 |
|
60 // --------------------------------------------------------------------------- |
|
61 // TNATServerSettings::SetAddressL |
|
62 // --------------------------------------------------------------------------- |
|
63 // |
|
64 EXPORT_C void TNATServerSettings::SetUsernameL( const TDesC8& aUsername ) |
|
65 { |
|
66 __ASSERT_ALWAYS( aUsername.Length() < KNATFWMaxUsernameLength, |
|
67 User::Leave( KErrOverflow ) ); |
|
68 iUsername.Copy( aUsername ); |
|
69 } |
|
70 |
|
71 |
|
72 // --------------------------------------------------------------------------- |
|
73 // TNATServerSettings::SetAddressL |
|
74 // --------------------------------------------------------------------------- |
|
75 // |
|
76 EXPORT_C void TNATServerSettings::SetPasswordL( const TDesC8& aPassword ) |
|
77 { |
|
78 __ASSERT_ALWAYS( aPassword.Length() < KNATFWMaxPasswordLength, |
|
79 User::Leave( KErrOverflow ) ); |
|
80 iPassword.Copy( aPassword ); |
|
81 } |
|
82 |
|
83 |
|
84 // --------------------------------------------------------------------------- |
|
85 // TNATServerSettings::Address |
|
86 // --------------------------------------------------------------------------- |
|
87 // |
|
88 EXPORT_C const TDesC8& TNATServerSettings::Address() const |
|
89 { |
|
90 return iAddress; |
|
91 } |
|
92 |
|
93 |
|
94 // --------------------------------------------------------------------------- |
|
95 // TNATServerSettings::Port |
|
96 // --------------------------------------------------------------------------- |
|
97 // |
|
98 EXPORT_C TUint TNATServerSettings::Port() const |
|
99 { |
|
100 return iPort; |
|
101 } |
|
102 |
|
103 |
|
104 // --------------------------------------------------------------------------- |
|
105 // TNATServerSettings::TCPTimeout |
|
106 // --------------------------------------------------------------------------- |
|
107 // |
|
108 EXPORT_C TUint TNATServerSettings::TCPTimeout() const |
|
109 { |
|
110 return iTCPTimeout; |
|
111 } |
|
112 |
|
113 |
|
114 // --------------------------------------------------------------------------- |
|
115 // TNATServerSettings::UDPTimeout |
|
116 // --------------------------------------------------------------------------- |
|
117 // |
|
118 EXPORT_C TUint TNATServerSettings::UDPTimeout() const |
|
119 { |
|
120 return iUDPTimeout; |
|
121 } |
|
122 |
|
123 |
|
124 // --------------------------------------------------------------------------- |
|
125 // TNATServerSettings::ConnectivityCheckTimeout |
|
126 // --------------------------------------------------------------------------- |
|
127 // |
|
128 EXPORT_C TUint TNATServerSettings::ConnectivityCheckTimeout() const |
|
129 { |
|
130 return iConnectivityCheckTimeout; |
|
131 } |
|
132 |
|
133 |
|
134 // --------------------------------------------------------------------------- |
|
135 // TNATServerSettings::CRLFRefreshEnabled |
|
136 // --------------------------------------------------------------------------- |
|
137 // |
|
138 EXPORT_C TBool TNATServerSettings::CRLFRefreshEnabled() const |
|
139 { |
|
140 return iCRLFRefreshEnabled; |
|
141 } |
|
142 |
|
143 |
|
144 // --------------------------------------------------------------------------- |
|
145 // TNATServerSettings::Username |
|
146 // --------------------------------------------------------------------------- |
|
147 // |
|
148 EXPORT_C const TDesC8& TNATServerSettings::Username() const |
|
149 { |
|
150 return iUsername; |
|
151 } |
|
152 |
|
153 |
|
154 // --------------------------------------------------------------------------- |
|
155 // TNATServerSettings::Password |
|
156 // --------------------------------------------------------------------------- |
|
157 // |
|
158 EXPORT_C const TDesC8& TNATServerSettings::Password() const |
|
159 { |
|
160 return iPassword; |
|
161 } |
|
162 |
|
163 //End of file |
|
164 |