linklayerprotocols/pppnif/INC/ncpip6.h
changeset 0 af10295192d8
equal deleted inserted replaced
-1:000000000000 0:af10295192d8
       
     1 // Copyright (c) 2003-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 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @internalComponent 
       
    19 */
       
    20 
       
    21 #ifndef __NCPIP6_H__
       
    22 #define __NCPIP6_H__
       
    23 
       
    24 #include <eui_addr.h>	// TE64Addr
       
    25 #include <comms-infras/ss_protflow.h>
       
    26 #include <comms-infras/es_protbinder.h>
       
    27 #include <networking/ppplcp.h>
       
    28 #include <networking/pppbase.h>
       
    29 #include <comms-infras/commsdebugutility.h>
       
    30 
       
    31 const TUint KPpp6MajorVersionNumber=0;
       
    32 const TUint KPpp6MinorVersionNumber=1;
       
    33 const TUint KPpp6BuildVersionNumber=1;
       
    34 
       
    35 const TUint KIp6cpSendPriority = 10;
       
    36 
       
    37 const TUint KPppIdIp6cp = 0x8057;
       
    38 const TUint KPppIdIp6 = 0x0057;
       
    39 
       
    40 const TUint8 KPppIp6cpOptInterfaceIdentifier = 1;
       
    41 const TUint8 KPppIp6cpOptCompressionProtocol = 2;
       
    42 
       
    43 NONSHARABLE_CLASS(CPppBinderIp6) : public CBase, public MPppFsm,
       
    44 								   public ESock::MLowerDataSender, public ESock::MLowerControl
       
    45 /**
       
    46 Implements IPCP and support for IP datagrams (RFC 1332)
       
    47 
       
    48 @internalComponent
       
    49 */
       
    50 	{
       
    51 public:
       
    52    	static CPppBinderIp6* NewL(CPppLcp* aLcp);
       
    53 	~CPppBinderIp6();
       
    54 
       
    55     //-=========================================================
       
    56     // MLowerDataSender methods
       
    57     //-=========================================================
       
    58 	virtual ESock::MLowerDataSender::TSendResult Send(RMBufChain& aPdu);
       
    59 
       
    60     //-=========================================================
       
    61 	// MLowerControl methods
       
    62     //-=========================================================
       
    63 	virtual TInt GetName(TDes& aName);
       
    64 	virtual TInt BlockFlow(ESock::MLowerControl::TBlockOption /*aOption*/);
       
    65     virtual TInt GetConfig(TBinderConfig& aConfig);
       
    66     virtual TInt Control(TUint aLevel, TUint aName, TDes8& aOption);
       
    67 
       
    68     //-=========================================================
       
    69     // Callthrough from MFlowBinderControl instance
       
    70     //-=========================================================
       
    71     ESock::MLowerDataSender* BindL(ESock::MUpperDataReceiver& aUpperReceiver, ESock::MUpperControl& aControl);
       
    72     void UnBind(ESock::MUpperDataReceiver& aUpperReceiver, ESock::MUpperControl& aControl);
       
    73 
       
    74 	TBool MatchesUpperControl(const ESock::MUpperControl* aUpperControl) const;
       
    75 
       
    76 #if EPOC_SDK >= 0x06010000
       
    77 	TInt Notification(TAgentToNifEventType aEvent);
       
    78 #endif
       
    79 
       
    80 	void SendFlowOn();
       
    81     void Error(TInt aError);
       
    82 	
       
    83 	void RecvIp(RMBufChain& aPacket);
       
    84 	void Ip6FrameError();
       
    85 	void Ip6KillProtocol();
       
    86 
       
    87 protected:
       
    88 	virtual TInt FsmLayerStarted();
       
    89 	virtual void FsmLayerFinished(TInt aReason = KErrNone);
       
    90 	virtual void FsmLayerUp();
       
    91 	virtual void FsmLayerDown(TInt aReason = KErrNone);
       
    92 	virtual void FsmFillinConfigRequestL(RPppOptionList& aRequestList);
       
    93 	virtual void FsmCheckConfigRequest(RPppOptionList& aRequestList, RPppOptionList& aAckList, RPppOptionList& aNakList, RPppOptionList& aRejList);
       
    94 	virtual void FsmApplyConfigRequest(RPppOptionList& aRequestList);
       
    95 	virtual void FsmRecvConfigAck(RPppOptionList& aReplyList);
       
    96 	virtual void FsmRecvConfigNak(RPppOptionList& aReplyList, RPppOptionList& aReqList);
       
    97 	virtual void FsmRecvConfigReject(RPppOptionList& aReplyList, RPppOptionList& aReqList);
       
    98 	virtual void FsmTerminationPhaseComplete();
       
    99 	virtual TBool FsmRecvUnknownCode(TUint8 aCode, TUint8 aId, TInt aLength, RMBufChain& aPacket);
       
   100 	virtual void KillProtocol();
       
   101 
       
   102     private:
       
   103 	static TInt SendCallBack(TAny* aCProtocol);
       
   104 	void DoSend();
       
   105 
       
   106 private:
       
   107    	CPppBinderIp6(CPppLcp* aLcp);
       
   108 	void  ConstructL();
       
   109 	
       
   110 	inline CPppLcp* Flow();
       
   111 
       
   112 private:
       
   113     //-=========================================================
       
   114     // Layer infrastructure
       
   115     //-=========================================================
       
   116     CPppLcp* iPppNifSubConnectionFlow;
       
   117 
       
   118 	ESock::MUpperDataReceiver* iUpperReceiver;
       
   119     ESock::MUpperControl* iUpperControl;
       
   120 
       
   121 //	CProtocolBase* iNetwork;
       
   122 
       
   123 	RMBufPktQ iSendQ;
       
   124 	CAsyncCallBack* iSendCallBack;
       
   125 
       
   126 	ESock::MLowerDataSender::TSendResult iLowerFlowOn;
       
   127 	ESock::MLowerDataSender::TSendResult iUpperFlowOn;
       
   128 
       
   129 	TPppExtraRecvr<CPppBinderIp6> iIpRecvr;
       
   130 
       
   131 	TE64Addr iLocalIfId;
       
   132 	TE64Addr iRemoteIfId;
       
   133 	TIp6Addr iPrimaryDns;
       
   134 	TIp6Addr iSecondaryDns;
       
   135 
       
   136 	TInterfaceName iIfName;
       
   137 
       
   138     __FLOG_DECLARATION_MEMBER;
       
   139 
       
   140 };
       
   141 
       
   142 //
       
   143 // Inline functions
       
   144 //
       
   145 
       
   146 CPppLcp* CPppBinderIp6::Flow()
       
   147 	{
       
   148 	return iPppNifSubConnectionFlow;
       
   149 	}
       
   150 
       
   151 
       
   152 #endif