telephonyprotocols/rawipnif/rawipnif2/inc/IPv4Binder.h
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
child 42 3adadc800673
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 
       
    28 class CBttLogger;
       
    29 
       
    30 class CIPv4Binder : public CBinderBase
       
    31 {
       
    32 public:
       
    33 	CIPv4Binder(CRawIP2Flow& aFlow, CBttLogger* aTheLogger);
       
    34 	~CIPv4Binder();
       
    35 
       
    36 public:
       
    37     // from BasebandChannelAdaptation2
       
    38 	virtual ESock::MLowerDataSender::TSendResult Send(RCommsBufChain& aPdu);
       
    39 	virtual void Process(RCommsBufChain& aPdu);
       
    40 	
       
    41     // from ESock
       
    42 	virtual ESock::MLowerDataSender::TSendResult Send(RMBufChain& aPdu);
       
    43 	virtual void Process(RMBufChain& aPdu);
       
    44 	
       
    45 	// from MLowerControl
       
    46 	virtual TInt GetName(TDes& aName);
       
    47 	virtual TInt GetConfig(TBinderConfig& aConfig);
       
    48 	virtual TInt Control(TUint aLevel, TUint aName, TDes8& aOption);
       
    49 
       
    50 	ESock::MLowerDataSender* Bind(ESock::MUpperDataReceiver* aUpperReceiver , ESock::MUpperControl* aUpperControl);
       
    51 	void Unbind (ESock::MUpperDataReceiver* aUpperReceiver, ESock::MUpperControl* aUpperControl);
       
    52 
       
    53 	virtual TInt Notification(TAgentToNifEventType aEvent, void * aInfo);
       
    54 	virtual void StartSending();
       
    55 
       
    56 	virtual TBool WantsProtocol(TUint16 aProtocolCode);
       
    57 	
       
    58 
       
    59 	virtual void SetProvision(const CIPConfig& aProvision);
       
    60 
       
    61 	virtual void UpdateContextConfigL(const TPacketDataConfigBase& aConfig);
       
    62 
       
    63 	virtual void UpdateConnectionSpeed(TUint aConnectionSpeed);
       
    64 
       
    65 	// Define the class that will hold the IPv4 setting required by the Nif.
       
    66 	class TIPv4Settings
       
    67 		{
       
    68 	public:
       
    69 		// As this is IPv4, all addresses are 32-bit.
       
    70 		TUint32	iLocalAddr;
       
    71 		TUint32	iNetMask;
       
    72 		TUint32	iBroadcastAddr;
       
    73 		TUint32	iDefGateway;
       
    74 		TUint32	iPrimaryDns;
       
    75 		TUint32	iSecondaryDns;
       
    76 		TBool iGetGatewayFromServer;
       
    77 		TBool iGetDnsFromServer;
       
    78 		};
       
    79 
       
    80 private:
       
    81 #ifdef WCDMA_STUB
       
    82 	TInt DeleteContext(TDes8& aContextParameters);
       
    83 #endif
       
    84 
       
    85 	inline void WriteIfName(TDes& aName) const;
       
    86 
       
    87 #ifdef __BTT_LOGGING__
       
    88 	void LogPacket(const RMBufChain& aPacket);
       
    89 #endif // __BTT_LOGGING__
       
    90 
       
    91 private: //owned
       
    92 	TIPv4Settings iSettings;
       
    93 	TUint iSpeedMetric;
       
    94 };
       
    95 
       
    96 void CIPv4Binder::WriteIfName(TDes& aName) const
       
    97 /**
       
    98  * Used to uniquely identify the current Nif instance
       
    99  *
       
   100  * @param aName Descriptor that will be initialised.
       
   101  */
       
   102 	{
       
   103 	aName.Format(_L("%S[0x%X]"), &KIPv4ProtocolIfName, this);
       
   104 	}
       
   105 
       
   106 #endif // IPV4BINDER_H__