wlan_bearer/wlannwif/inc/CLanIp6Bearer.h
changeset 0 c40eb8fe8501
equal deleted inserted replaced
-1:000000000000 0:c40eb8fe8501
       
     1 /*
       
     2 * Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Defines LanIp6Bearer class
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: 6 %
       
    20 */
       
    21 
       
    22 #ifndef CLANIP6BEARER_H
       
    23 #define CLANIP6BEARER_H
       
    24 
       
    25 #include "CLanxBearer.h"
       
    26 #include <eui_addr.h>
       
    27 #include "WlanProvision.h"
       
    28 
       
    29 /**
       
    30 @internalComponent
       
    31 */
       
    32 const TUint8 KMulticastPrefix[2] = {0x33, 0x33};
       
    33 
       
    34 struct TIpv6Header
       
    35 {
       
    36 	TUint8 GetVersion() { return (TUint8)((iVersionClassHi>>4)&0xff);}
       
    37 	TUint8 GetClass() { return (TUint8)( ((iVersionClassHi<<4)| (iClassLoFlowHi>>4)) &0xff); }
       
    38 	TUint8 iVersionClassHi; // The Upper nybble provides version.
       
    39 	TUint8 iClassLoFlowHi;
       
    40 	TUint16 iFlowLo; // Two bytes, but it doesn't start on a word boundary.
       
    41 	TUint16 iPayloadLength;
       
    42 	TUint8 iNextHeader;
       
    43 	TUint8 iHopLimit;
       
    44 	union
       
    45 		{
       
    46 		TUint8 iSourceAddrB[16];
       
    47 		TUint16 iSourceAddrW[8];
       
    48 		TUint32 iSourceAddrL[4];
       
    49 		};
       
    50 	union
       
    51 		{
       
    52 		TUint8 iDestAddrB[16];
       
    53 		TUint16 iDestAddrW[8];
       
    54 		TUint32 iDestAddrL[4];
       
    55 		};
       
    56 };
       
    57 
       
    58 
       
    59 NONSHARABLE_CLASS(CLanIp6Bearer) : public CLanxBearer
       
    60 {
       
    61 public:
       
    62 	CLanIp6Bearer(CLANLinkCommon* aLink);
       
    63 	virtual void ConstructL();
       
    64 
       
    65 	// MLowerControl
       
    66 	virtual TInt Control(TUint aLevel,TUint aName,TDes8& aOption);
       
    67 	virtual TInt GetConfig(TBinderConfig& aConfig);
       
    68 
       
    69 	// MLowerDataSender
       
    70 	virtual MLowerDataSender::TSendResult Send(RMBufChain& aPdu);
       
    71 
       
    72 	//Additional methods.
       
    73 	// Perhaps need different version of this
       
    74 	virtual TBool WantsProtocol(TUint16 aProtocolCode,const TUint8* aPayload);
       
    75 	virtual void Process(RMBufChain& aPdu);
       
    76 	virtual void UpdateMACAddr();
       
    77 
       
    78 	virtual const TDesC8& ProtocolName() const;
       
    79 	
       
    80 	// Support for provisioning
       
    81 	virtual void SetProvisionL(const Meta::SMetaData* aProvision);
       
    82 
       
    83 private:
       
    84 	void ResolveMulticastIp6(TDes8& aDstAddr,RMBufChain& aPdu);
       
    85 	void ReadCommDbLanSettingsL();
       
    86 
       
    87 	enum {KIPProtocol=0x800, KIP6Protocol=6};
       
    88 	
       
    89 	TEui64Addr iEuiMac;
       
    90 	TIp6Addr iPrimaryDns;
       
    91 	TIp6Addr iSecondaryDns;
       
    92 
       
    93 	const TLanIp6Provision* iProvision;		// Provisioning information from SCPR
       
    94 };
       
    95 
       
    96 inline CLanIp6Bearer::CLanIp6Bearer(CLANLinkCommon* aLink) : 
       
    97    CLanxBearer(aLink)
       
    98 {
       
    99 }
       
   100 
       
   101 
       
   102 #endif // CLANIP6BEARER_H