31 #include "RawIPFlow.h" |
31 #include "RawIPFlow.h" |
32 #include "IPv6Binder.h" |
32 #include "IPv6Binder.h" |
33 #include <comms-infras/linkprovision.h> |
33 #include <comms-infras/linkprovision.h> |
34 #include <e32hal.h> |
34 #include <e32hal.h> |
35 #include <u32hal.h> |
35 #include <u32hal.h> |
|
36 #include <rawip_const.h> |
36 |
37 |
37 using namespace ESock; |
38 using namespace ESock; |
38 #ifdef WCDMA_STUB |
39 #ifdef WCDMA_STUB |
39 #include <networking/umtsnifcontrolif.h> |
40 #include <networking/umtsnifcontrolif.h> |
40 #endif |
41 #endif |
41 |
42 |
42 |
|
43 #ifdef __EABI__ |
|
44 // Patch data is used and KMtuIPv6 and KRMtuIPv6 can be modified to a different value in RawIpNif.iby file |
|
45 extern const TInt KMtuIPv6 = KDefaultMtu; |
|
46 extern const TInt KRMtuIPv6 = KDefaultMtu; |
|
47 #endif |
|
48 |
43 |
49 CIPv6Binder::CIPv6Binder(CRawIPFlow& aFlow) |
44 CIPv6Binder::CIPv6Binder(CRawIPFlow& aFlow) |
50 /** |
45 /** |
51 * Constructor |
46 * Constructor |
52 */ |
47 */ |
68 * |
63 * |
69 * @param aUpperReceiver A pointer to Upper layer Receive class |
64 * @param aUpperReceiver A pointer to Upper layer Receive class |
70 * @param aUpperControl A pointer to Upper layer control class |
65 * @param aUpperControl A pointer to Upper layer control class |
71 */ |
66 */ |
72 { |
67 { |
|
68 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CIPV6BINDER_BIND_1, "CIPv6Binder::Bind"); |
73 CBinderBase::Bind(aUpperReceiver, aUpperControl); // Call the superclass's method. |
69 CBinderBase::Bind(aUpperReceiver, aUpperControl); // Call the superclass's method. |
74 return this; |
70 return this; |
75 } |
71 } |
76 |
72 |
77 TInt CIPv6Binder::Control(TUint aLevel, TUint aName, TDes8& /*aOption*/) |
73 TInt CIPv6Binder::Control(TUint aLevel, TUint aName, TDes8& /*aOption*/) |
160 return KErrNotSupported; |
156 return KErrNotSupported; |
161 } |
157 } |
162 |
158 |
163 TInt CIPv6Binder::GetConfig(TBinderConfig& aConfig) |
159 TInt CIPv6Binder::GetConfig(TBinderConfig& aConfig) |
164 { |
160 { |
|
161 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CIPV6BINDER_GETCONFIG_1, "CIPv6Binder::GetConfig"); |
|
162 |
165 TBinderConfig6* config = TBinderConfig::Cast<TBinderConfig6>(aConfig); |
163 TBinderConfig6* config = TBinderConfig::Cast<TBinderConfig6>(aConfig); |
166 |
164 |
167 if(config == NULL) |
165 if(config == NULL) |
168 { |
166 { |
169 return KErrNotSupported; |
167 return KErrNotSupported; |
173 |
171 |
174 config->iInfo.iFeatures = KIfCanBroadcast | KIfCanMulticast; /* Feature flags */ |
172 config->iInfo.iFeatures = KIfCanBroadcast | KIfCanMulticast; /* Feature flags */ |
175 |
173 |
176 #if defined __EABI__ |
174 #if defined __EABI__ |
177 // Default value for Tx and Rx packet size |
175 // Default value for Tx and Rx packet size |
178 config->iInfo.iMtu = KMtuIPv6; |
176 config->iInfo.iMtu = RawIPConst::KMtuIPv6; |
179 config->iInfo.iRMtu = KRMtuIPv6; |
177 config->iInfo.iRMtu = RawIPConst::KRMtuIPv6; |
180 #else // WINS |
178 #else // WINS |
181 // Set default values in case patch is not present in epoc.ini |
179 // Set default values in case patch is not present in epoc.ini |
182 config->iInfo.iMtu = KDefaultMtu; |
180 config->iInfo.iMtu = KDefaultMtu; |
183 config->iInfo.iRMtu = KDefaultMtu; |
181 config->iInfo.iRMtu = KDefaultMtu; |
184 |
182 |
185 // for the emulator process is patched via the epoc.ini file |
183 // for the emulator process is patched via the epoc.ini file |
186 UserSvr::HalFunction(EHalGroupEmulator,EEmulatorHalIntProperty,(TAny*)"rawip_KMtuIPv6",&(config->iInfo.iMtu)); |
184 UserSvr::HalFunction(EHalGroupEmulator,EEmulatorHalIntProperty,(TAny*)"rawip_KMtuIPv6",&(config->iInfo.iMtu)); |
187 UserSvr::HalFunction(EHalGroupEmulator,EEmulatorHalIntProperty,(TAny*)"rawip_KRMtuIPv6",&(config->iInfo.iRMtu)); |
185 UserSvr::HalFunction(EHalGroupEmulator,EEmulatorHalIntProperty,(TAny*)"rawip_KRMtuIPv6",&(config->iInfo.iRMtu)); |
188 #endif |
186 #endif |
|
187 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CIPV6BINDER_GETCONFIG_2, "config->{iInfo.iMtu=%d, iInfo.iRMtu=%d}", config->iInfo.iMtu, config->iInfo.iRMtu); |
189 |
188 |
190 config->iInfo.iSpeedMetric = iSpeedMetric; /* approximation of the interface speed in Kbps. */ |
189 config->iInfo.iSpeedMetric = iSpeedMetric; /* approximation of the interface speed in Kbps. */ |
191 |
190 |
192 TEui64Addr& localId = TEui64Addr::Cast(config->iLocalId); |
191 TEui64Addr& localId = TEui64Addr::Cast(config->iLocalId); |
193 localId = iSettings.iLocalIfId; |
192 localId = iSettings.iLocalIfId; |
334 * Sets the speed metric to return to TCP/IP, based on what the TSY tells us. |
333 * Sets the speed metric to return to TCP/IP, based on what the TSY tells us. |
335 * |
334 * |
336 * @param aConnectionSpeed Our connection speed |
335 * @param aConnectionSpeed Our connection speed |
337 */ |
336 */ |
338 { |
337 { |
339 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CIPV6BINDER_UPDATECONNECTIONSPEED_1, "CIPv6Binder::UpdateConnectionSpeed"); |
338 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CIPV6BINDER_UPDATECONNECTIONSPEED_1, "ConnectionSpeed [%d]", aConnectionSpeed); |
340 |
339 |
341 iSpeedMetric = aConnectionSpeed; |
340 iSpeedMetric = aConnectionSpeed; |
342 } |
341 } |
343 |
342 |
344 |
343 |