telephonyprotocols/rawipnif/rawipnif2/inc/IPv6Binder.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 CIPv6Flow class, which handles the transmission
       
    15 // of IPv6 data to and from the TCP/IP stack.
       
    16 // 
       
    17 //
       
    18 
       
    19 /**
       
    20  @file
       
    21 */
       
    22 
       
    23 #ifndef IPV6BINDER_H__
       
    24 #define IPV6BINDER_H__
       
    25 
       
    26 #include "BinderBase.h"
       
    27 #include <eui_addr.h>
       
    28 
       
    29 class CBttLogger;
       
    30 
       
    31 class CIPv6Binder : public CBinderBase
       
    32 {
       
    33 public:
       
    34 	CIPv6Binder(CRawIP2Flow& aFlow, CBttLogger* aTheLogger);
       
    35 	~CIPv6Binder();
       
    36 
       
    37 public:
       
    38     // from BasebandChannelAdaptation2
       
    39 	virtual ESock::MLowerDataSender::TSendResult Send(RCommsBufChain& aPdu);
       
    40 	virtual void Process(RCommsBufChain& aPdu);
       
    41 	
       
    42     // from ESock
       
    43 	virtual ESock::MLowerDataSender::TSendResult Send(RMBufChain& aPdu);
       
    44 	virtual void Process(RMBufChain& aPdu);
       
    45 	
       
    46 	// from MLowerControl
       
    47 	virtual TInt GetName(TDes& aName);
       
    48 	virtual TInt GetConfig(TBinderConfig& aConfig);
       
    49 	virtual TInt Control(TUint aLevel, TUint aName, TDes8& aOption);
       
    50 
       
    51 	ESock::MLowerDataSender* Bind(ESock::MUpperDataReceiver* aUpperReceiver , ESock::MUpperControl* aUpperControl);
       
    52 	void Unbind (ESock::MUpperDataReceiver* aUpperReceiver, ESock::MUpperControl* aUpperControl);
       
    53 
       
    54 	virtual TInt Notification(TAgentToNifEventType aEvent, void * aInfo);
       
    55 	virtual void StartSending();
       
    56 
       
    57 	virtual TBool WantsProtocol(TUint16 aProtocolCode);
       
    58 	
       
    59 
       
    60 	virtual void SetProvision(const CIPConfig& aProvision);
       
    61 
       
    62 	virtual void UpdateContextConfigL(const TPacketDataConfigBase& aConfig);
       
    63 
       
    64 	virtual void UpdateConnectionSpeed(TUint aConnectionSpeed);
       
    65 
       
    66 	// Define the class that will hold the IPv6 setting required by the Nif.
       
    67 	class TIPv6Settings
       
    68 		{
       
    69 	public:
       
    70 		TIp6Addr iLocalAddr;
       
    71 		TIp6Addr iPrimaryDns;
       
    72 		TIp6Addr iSecondaryDns;
       
    73 		TBool iGetDnsFromServer;
       
    74 		TBool iGetIpFromServer;
       
    75 		TE64Addr iLocalIfId;
       
    76 		//TE64Addr iRemoteIfId;
       
    77 		};
       
    78 
       
    79 private:
       
    80 #ifdef WCDMA_STUB
       
    81 	TInt DeleteContext(TDes8& aContextParameters);
       
    82 #endif
       
    83 
       
    84 	inline void WriteIfName(TDes& aName) const;
       
    85 
       
    86 #ifdef __BTT_LOGGING__
       
    87 	void LogPacket(const RMBufChain& aPacket);
       
    88 #endif // __BTT_LOGGING__
       
    89 
       
    90 private: //unowned
       
    91 	CBttLogger* iTheLogger;
       
    92 
       
    93 private: //owned
       
    94 	TIPv6Settings iSettings;
       
    95 	TUint iSpeedMetric;
       
    96 };
       
    97 
       
    98 void CIPv6Binder::WriteIfName(TDes& aName) const
       
    99 /**
       
   100  * Used to uniquely identify the current Nif instance
       
   101  *
       
   102  * @param aName Descriptor that will be initialised.
       
   103  */
       
   104 	{
       
   105 	aName.Format(_L("%S[0x%X]"), &KIPv6ProtocolIfName, this);
       
   106 	}
       
   107 
       
   108 #endif // IPV6BINDER_H__