telephonyprotocols/rawipnif/src/IPv4Binder.cpp
branchRCL_3
changeset 9 2492a6e4aed7
parent 7 fe8b59ab9fa0
child 19 630d2f34d719
equal deleted inserted replaced
8:3f227a47ad75 9:2492a6e4aed7
    23 #include <etelpckt.h>
    23 #include <etelpckt.h>
    24 #include <in_iface.h>
    24 #include <in_iface.h>
    25 #include "RawIPFlow.h"
    25 #include "RawIPFlow.h"
    26 #include "IPv4Binder.h"
    26 #include "IPv4Binder.h"
    27 #include <comms-infras/linkprovision.h>
    27 #include <comms-infras/linkprovision.h>
       
    28 #include <u32hal.h>
    28 
    29 
    29 using namespace ESock;
    30 using namespace ESock;
    30 #ifdef WCDMA_STUB
    31 #ifdef WCDMA_STUB
    31 #include <networking/umtsnifcontrolif.h>
    32 #include <networking/umtsnifcontrolif.h>
    32 #endif
    33 #endif
    33 
    34 
    34 #define LOG_IP_ADDRESS(desc,addr) _LOG_L1C5(_L8("    " desc " = %d.%d.%d.%d"), \
    35 #define LOG_IP_ADDRESS(desc,addr) _LOG_L1C5(_L8("    " desc " = %d.%d.%d.%d"), \
    35 			addr >> 24, (addr >> 16) & 0xFF, (addr >> 8) & 0xFF, addr & 0xFF);
    36 			addr >> 24, (addr >> 16) & 0xFF, (addr >> 8) & 0xFF, addr & 0xFF);
       
    37 
       
    38 #ifdef __EABI__
       
    39 // Patch data is used and KMtuIPv4 and KRMtuIPv4 can be modified to a different value in RawIpNif.iby file
       
    40 extern const TInt KMtuIPv4 = KDefaultMtu;
       
    41 extern const TInt KRMtuIPv4 = KDefaultMtu;
       
    42 #endif
    36 
    43 
    37 CIPv4Binder::CIPv4Binder(CRawIPFlow& aFlow, CBttLogger* aTheLogger)
    44 CIPv4Binder::CIPv4Binder(CRawIPFlow& aFlow, CBttLogger* aTheLogger)
    38 /**
    45 /**
    39  * Constructor
    46  * Constructor
    40  */ 
    47  */ 
   162    		}
   169    		}
   163 	
   170 	
   164 	config->iFamily = KAfInet;		/* KAfInet - selects TBinderConfig4 */
   171 	config->iFamily = KAfInet;		/* KAfInet - selects TBinderConfig4 */
   165 	
   172 	
   166 	config->iInfo.iFeatures = KIfCanBroadcast | KIfCanMulticast;		/* Feature flags */
   173 	config->iInfo.iFeatures = KIfCanBroadcast | KIfCanMulticast;		/* Feature flags */
   167 	config->iInfo.iMtu = KDefaultMtu;				/* Maximum transmission unit. */
   174 	
   168 	config->iInfo.iRMtu = KDefaultMtu;				/* Maximum transmission unit for receiving. */
   175 	
       
   176 #if defined __EABI__
       
   177     // Default value for Tx and Rx packet size
       
   178     config->iInfo.iMtu = KMtuIPv4;
       
   179     config->iInfo.iRMtu = KRMtuIPv4;
       
   180 #else // WINS
       
   181     // Set default values in case patch is not present in epoc.ini
       
   182     config->iInfo.iMtu = KDefaultMtu;
       
   183     config->iInfo.iRMtu = KDefaultMtu;
       
   184            
       
   185     // for the emulator process is patched via the epoc.ini file
       
   186     UserSvr::HalFunction(EHalGroupEmulator,EEmulatorHalIntProperty,(TAny*)"rawip_KMtuIPv4",&(config->iInfo.iMtu));
       
   187     UserSvr::HalFunction(EHalGroupEmulator,EEmulatorHalIntProperty,(TAny*)"rawip_KRMtuIPv4",&(config->iInfo.iRMtu));
       
   188 #endif
       
   189 	
   169 	config->iInfo.iSpeedMetric = iSpeedMetric;		/* approximation of the interface speed in Kbps. */
   190 	config->iInfo.iSpeedMetric = iSpeedMetric;		/* approximation of the interface speed in Kbps. */
   170 
   191 
   171     LOG_IP_ADDRESS("Local IP address from TBinderConfig", iSettings.iLocalAddr);
   192     LOG_IP_ADDRESS("Local IP address from TBinderConfig", iSettings.iLocalAddr);
   172 	
   193 	
   173 	config->iAddress.SetAddress(iSettings.iLocalAddr);		/* Interface IP address. */
   194 	config->iAddress.SetAddress(iSettings.iLocalAddr);		/* Interface IP address. */