telephonyprotocols/rawipnif/inc/IPv4Binder.h
changeset 0 3553901f7fa8
child 19 630d2f34d719
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // This file defines the CIPv4Flow class, which handles the transmission
       
    15 // of IPv4 data to and from the TCP/IP stack.
       
    16 // 
       
    17 //
       
    18 
       
    19 /**
       
    20  @file
       
    21 */
       
    22 
       
    23 #ifndef IPV4BINDER_H__
       
    24 #define IPV4BINDER_H__
       
    25 
       
    26 #include "BinderBase.h"
       
    27 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    28 #include <comms-infras/nifprvar_internal.h>
       
    29 #endif
       
    30 
       
    31 class CBttLogger;
       
    32 
       
    33 class CIPv4Binder : public CBinderBase
       
    34 {
       
    35 public:
       
    36 	CIPv4Binder(CRawIPFlow& aFlow, CBttLogger* aTheLogger);
       
    37 	~CIPv4Binder();
       
    38 
       
    39 public:
       
    40     // from MLowerDataSender
       
    41 	virtual ESock::MLowerDataSender::TSendResult Send(RMBufChain& aPdu);
       
    42 
       
    43 	// from MLowerControl
       
    44 	virtual TInt GetName(TDes& aName);
       
    45 	virtual TInt GetConfig(TBinderConfig& aConfig);
       
    46 	virtual TInt Control(TUint aLevel, TUint aName, TDes8& aOption);
       
    47 
       
    48 	ESock::MLowerDataSender* Bind(ESock::MUpperDataReceiver* aUpperReceiver , ESock::MUpperControl* aUpperControl);
       
    49 	void Unbind (ESock::MUpperDataReceiver* aUpperReceiver, ESock::MUpperControl* aUpperControl);
       
    50 
       
    51 	virtual TInt Notification(TAgentToNifEventType aEvent, void * aInfo);
       
    52 	virtual void StartSending();
       
    53 
       
    54 	virtual TBool WantsProtocol(TUint16 aProtocolCode);
       
    55 	virtual void Process(RMBufChain& aPdu);
       
    56 
       
    57 	virtual void SetProvision(const CIPConfig& aProvision);
       
    58 
       
    59 	virtual void UpdateContextConfigL(const TPacketDataConfigBase& aConfig);
       
    60 
       
    61 	virtual void UpdateConnectionSpeed(TUint aConnectionSpeed);
       
    62 
       
    63 	// Define the class that will hold the IPv4 setting required by the Nif.
       
    64 	class TIPv4Settings
       
    65 		{
       
    66 	public:
       
    67 		// As this is IPv4, all addresses are 32-bit.
       
    68 		TUint32	iLocalAddr;
       
    69 		TUint32	iNetMask;
       
    70 		TUint32	iBroadcastAddr;
       
    71 		TUint32	iDefGateway;
       
    72 		TUint32	iPrimaryDns;
       
    73 		TUint32	iSecondaryDns;
       
    74 		TBool iGetGatewayFromServer;
       
    75 		TBool iGetDnsFromServer;
       
    76 		};
       
    77 
       
    78 private:
       
    79 #ifdef WCDMA_STUB
       
    80 	TInt DeleteContext(TDes8& aContextParameters);
       
    81 #endif
       
    82 	inline void WriteIfName(TDes& aName) const;
       
    83 
       
    84 #ifdef __BTT_LOGGING__
       
    85 	void LogPacket(const RMBufChain& aPacket);
       
    86 #endif // __BTT_LOGGING__
       
    87 
       
    88 private: //owned
       
    89 	TIPv4Settings iSettings;
       
    90 	TUint iSpeedMetric;
       
    91 };
       
    92 
       
    93 void CIPv4Binder::WriteIfName(TDes& aName) const
       
    94 /**
       
    95  * Used to uniquely identify the current Nif instance
       
    96  *
       
    97  * @param aName Descriptor that will be initialised.
       
    98  */
       
    99 	{
       
   100 	aName.Format(_L("%S[0x%X]"), &KIPv4ProtocolIfName, this);
       
   101 	}
       
   102 
       
   103 #endif // IPV4BINDER_H__