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