30 #include <in_iface.h> |
30 #include <in_iface.h> |
31 #include "RawIPFlow.h" |
31 #include "RawIPFlow.h" |
32 #include "IPv4Binder.h" |
32 #include "IPv4Binder.h" |
33 #include <comms-infras/linkprovision.h> |
33 #include <comms-infras/linkprovision.h> |
34 #include <u32hal.h> |
34 #include <u32hal.h> |
|
35 #include <rawip_const.h> |
35 |
36 |
36 using namespace ESock; |
37 using namespace ESock; |
37 #ifdef WCDMA_STUB |
38 #ifdef WCDMA_STUB |
38 #include <networking/umtsnifcontrolif.h> |
39 #include <networking/umtsnifcontrolif.h> |
39 #endif |
40 #endif |
40 |
41 |
41 |
42 |
42 #ifdef __EABI__ |
|
43 // Patch data is used and KMtuIPv4 and KRMtuIPv4 can be modified to a different value in RawIpNif.iby file |
|
44 extern const TInt KMtuIPv4 = KDefaultMtu; |
|
45 extern const TInt KRMtuIPv4 = KDefaultMtu; |
|
46 #endif |
|
47 |
|
48 CIPv4Binder::CIPv4Binder(CRawIPFlow& aFlow) |
43 CIPv4Binder::CIPv4Binder(CRawIPFlow& aFlow) |
49 /** |
44 /** |
50 * Constructor |
45 * Constructor |
51 */ |
46 */ |
52 : CBinderBase(aFlow), |
47 : CBinderBase(aFlow), |
67 * |
62 * |
68 * @param aUpperReceiver A pointer to Upper layer Receive class |
63 * @param aUpperReceiver A pointer to Upper layer Receive class |
69 * @param aUpperControl A pointer to Upper layer control class |
64 * @param aUpperControl A pointer to Upper layer control class |
70 */ |
65 */ |
71 { |
66 { |
|
67 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CIPV4BINDER_BIND_1, "CIPv4Binder::Bind"); |
72 CBinderBase::Bind(aUpperReceiver, aUpperControl); // Call the superclass's method. |
68 CBinderBase::Bind(aUpperReceiver, aUpperControl); // Call the superclass's method. |
73 return this; |
69 return this; |
74 } |
70 } |
75 |
71 |
76 TInt CIPv4Binder::Control(TUint aLevel, TUint aName, TDes8& aOption) |
72 TInt CIPv4Binder::Control(TUint aLevel, TUint aName, TDes8& aOption) |
176 config->iInfo.iFeatures = KIfCanBroadcast | KIfCanMulticast; /* Feature flags */ |
172 config->iInfo.iFeatures = KIfCanBroadcast | KIfCanMulticast; /* Feature flags */ |
177 |
173 |
178 |
174 |
179 #if defined __EABI__ |
175 #if defined __EABI__ |
180 // Default value for Tx and Rx packet size |
176 // Default value for Tx and Rx packet size |
181 config->iInfo.iMtu = KMtuIPv4; |
177 config->iInfo.iMtu = RawIPConst::KMtuIPv4; |
182 config->iInfo.iRMtu = KRMtuIPv4; |
178 config->iInfo.iRMtu = RawIPConst::KRMtuIPv4; |
183 #else // WINS |
179 #else // WINS |
184 // Set default values in case patch is not present in epoc.ini |
180 // Set default values in case patch is not present in epoc.ini |
185 config->iInfo.iMtu = KDefaultMtu; |
181 config->iInfo.iMtu = KDefaultMtu; |
186 config->iInfo.iRMtu = KDefaultMtu; |
182 config->iInfo.iRMtu = KDefaultMtu; |
187 |
183 |
188 // for the emulator process is patched via the epoc.ini file |
184 // for the emulator process is patched via the epoc.ini file |
189 UserSvr::HalFunction(EHalGroupEmulator,EEmulatorHalIntProperty,(TAny*)"rawip_KMtuIPv4",&(config->iInfo.iMtu)); |
185 UserSvr::HalFunction(EHalGroupEmulator,EEmulatorHalIntProperty,(TAny*)"rawip_KMtuIPv4",&(config->iInfo.iMtu)); |
190 UserSvr::HalFunction(EHalGroupEmulator,EEmulatorHalIntProperty,(TAny*)"rawip_KRMtuIPv4",&(config->iInfo.iRMtu)); |
186 UserSvr::HalFunction(EHalGroupEmulator,EEmulatorHalIntProperty,(TAny*)"rawip_KRMtuIPv4",&(config->iInfo.iRMtu)); |
191 #endif |
187 #endif |
|
188 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CIPV4BINDER_GETCONFIG_3, "config->{iInfo.iMtu=%d, iInfo.iRMtu=%d}", config->iInfo.iMtu, config->iInfo.iRMtu); |
192 |
189 |
193 config->iInfo.iSpeedMetric = iSpeedMetric; /* approximation of the interface speed in Kbps. */ |
190 config->iInfo.iSpeedMetric = iSpeedMetric; /* approximation of the interface speed in Kbps. */ |
194 |
191 |
195 OstTraceDefExt4(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CIPV4BINDER_GETCONFIG_2, "Local IP address from TBinderConfig = %u.%u.%u.%u",iSettings.iLocalAddr >> 24, (iSettings.iLocalAddr >> 16) & 0xFF, (iSettings.iLocalAddr >> 8) & 0xFF, iSettings.iLocalAddr & 0xFF); |
192 OstTraceDefExt4(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CIPV4BINDER_GETCONFIG_2, "Local IP address from TBinderConfig = %u.%u.%u.%u",iSettings.iLocalAddr >> 24, (iSettings.iLocalAddr >> 16) & 0xFF, (iSettings.iLocalAddr >> 8) & 0xFF, iSettings.iLocalAddr & 0xFF); |
196 |
193 |
362 * Sets the speed metric to return to TCP/IP, based on what the TSY tells us. |
359 * Sets the speed metric to return to TCP/IP, based on what the TSY tells us. |
363 * |
360 * |
364 * @param aConnectionSpeed Our connection speed |
361 * @param aConnectionSpeed Our connection speed |
365 */ |
362 */ |
366 { |
363 { |
367 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CIPV4BINDER_UPDATECONNECTIONSPEED_1, "CIPv4Binder::UpdateConnectionSpeed"); |
364 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CIPV4BINDER_UPDATECONNECTIONSPEED_1, "Connection Speed [%d]", aConnectionSpeed); |
368 |
365 |
369 iSpeedMetric = aConnectionSpeed; |
366 iSpeedMetric = aConnectionSpeed; |
370 } |
367 } |
371 |
368 |
372 |
369 |