|
1 // Copyright (c) 2002-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 __PPPUMTS_H__ |
|
22 #define __PPPUMTS_H__ |
|
23 #include "PPPBASE.H" |
|
24 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
25 #include <comms-infras/nifprvar_internal.h> |
|
26 #endif |
|
27 |
|
28 const TInt KMaxLinkInterfaceName = 20; |
|
29 |
|
30 /****************/ |
|
31 /* CProtocolPpp */ |
|
32 /****************/ |
|
33 |
|
34 class CPppUmtsLink; |
|
35 NONSHARABLE_CLASS(CProtocolPpp) : public CProtocolBase |
|
36 /** |
|
37 * Class used by PPP to receive data from lower layer Nif and send it up to LCP. |
|
38 */ |
|
39 { |
|
40 public: |
|
41 static CProtocolPpp* NewL(); |
|
42 CProtocolPpp(); |
|
43 ~CProtocolPpp(); |
|
44 |
|
45 // CProtocolBase mirrored functions to allow passing of data from lower layer Nif up to LCP |
|
46 inline virtual void Process(RMBufChain &,CProtocolBase* aSourceProtocol=NULL); // Up |
|
47 inline virtual void Process(TDes8& aPDU,TSockAddr *from,TSockAddr *to=NULL,CProtocolBase* aSourceProtocol=NULL); // Up |
|
48 inline virtual void StartSending(CProtocolBase* aProtocol); // Up |
|
49 inline virtual void Identify(TServerProtocolDesc* aProtocolDesc) const; |
|
50 |
|
51 void SetValue(CPppUmtsLink* aPppUmtsLink); |
|
52 private: |
|
53 CPppUmtsLink* iPppUmtsLink; |
|
54 }; |
|
55 |
|
56 /****************/ |
|
57 /* CPppUmtsLink */ |
|
58 /****************/ |
|
59 |
|
60 NONSHARABLE_CLASS(CPppUmtsLink) : public CPppLinkBase, public MNifIfNotify |
|
61 /** |
|
62 * Definition of the PPP "proxy" class which acts as a bridge between PPP and the lower layer Nif. |
|
63 */ |
|
64 { |
|
65 public: |
|
66 CPppUmtsLink(CPppLcp* aLcp, const TDesC& aParams); |
|
67 ~CPppUmtsLink(); |
|
68 |
|
69 // CProtocolBase API to lower layer Nif |
|
70 inline void Process(RMBufChain &,CProtocolBase* aSourceProtocol=NULL); // Up |
|
71 inline void Process(TDes8& aPDU,TSockAddr *from,TSockAddr *to=NULL,CProtocolBase* aSourceProtocol=NULL); // Up |
|
72 inline void StartSending(CProtocolBase* aProtocol); // Up |
|
73 |
|
74 // CPppLinkBase API to lower layer Nif |
|
75 virtual void CreateL(); |
|
76 inline virtual TInt Send(RMBufChain& aPacket, TUint aPppId=KPppIdAsIs); |
|
77 inline virtual void OpenL(); |
|
78 inline virtual void Close(); |
|
79 inline virtual void StartL(); |
|
80 virtual void Stop(TInt aReason, TBool aLinkDown=ETrue); |
|
81 inline virtual void GetSendRecvSize(TInt& aMaxRecvSize, TInt& aMaxSendSize); |
|
82 virtual TInt SpeedMetric(); |
|
83 inline virtual void GetDataTransfer(RPacketContext::TDataVolume&); |
|
84 |
|
85 // MNifIfNotify API to lower layer Nif |
|
86 inline virtual void LinkLayerDown(TInt aReason, TAction aAction); |
|
87 inline virtual void LinkLayerUp(); |
|
88 inline virtual void NegotiationFailed(CNifIfBase* aIf, TInt aReason); |
|
89 inline virtual TInt Authenticate(TDes& aUsername, TDes& aPassword); |
|
90 inline virtual void CancelAuthenticate(); |
|
91 inline virtual TInt GetExcessData(TDes8& aBuffer); |
|
92 inline virtual void IfProgress(TInt aStage, TInt aError); |
|
93 inline virtual void IfProgress(TSubConnectionUniqueId aSubConnectionUniqueId, TInt aStage, TInt aError); |
|
94 |
|
95 inline virtual void OpenRoute(); |
|
96 inline virtual void CloseRoute(); |
|
97 inline virtual TInt Notification(TNifToAgentEventType aEvent, void * aInfo = NULL); |
|
98 virtual void BinderLayerDown(CNifIfBase* aBinderIf, TInt aReason, TAction aAction); |
|
99 virtual TInt PacketActivity(TDataTransferDirection aDirection, TUint aBytes, TBool aResetTimer); |
|
100 |
|
101 inline virtual void NotifyDataSent(TSubConnectionUniqueId aSubConnectionUniqueId, TUint aUplinkVolume); |
|
102 inline virtual void NotifyDataReceived(TSubConnectionUniqueId aSubConnectionUniqueId, TUint aDownlinkVolume); |
|
103 inline virtual void NifEvent(TNetworkAdaptorEventType aEventType, TUint aEvent, const TDesC8& aEventData, TAny* aSource=0); |
|
104 |
|
105 |
|
106 protected: |
|
107 inline virtual TInt DoReadInt(const TDesC& aField, TUint32& aValue,const RMessagePtr2* aMessage); |
|
108 inline virtual TInt DoWriteInt(const TDesC& aField, TUint32 aValue,const RMessagePtr2* aMessage); |
|
109 inline virtual TInt DoReadDes(const TDesC& aField, TDes8& aValue,const RMessagePtr2* aMessage); |
|
110 inline virtual TInt DoReadDes(const TDesC& aField, TDes16& aValue,const RMessagePtr2* aMessage); |
|
111 inline virtual TInt DoWriteDes(const TDesC& aField, const TDesC8& aValue,const RMessagePtr2* aMessage); |
|
112 inline virtual TInt DoWriteDes(const TDesC& aField, const TDesC16& aValue,const RMessagePtr2* aMessage); |
|
113 inline virtual TInt DoReadBool(const TDesC& aField, TBool& aValue,const RMessagePtr2* aMessage); |
|
114 inline virtual TInt DoWriteBool(const TDesC& aField, TBool aValue,const RMessagePtr2* aMessage); |
|
115 |
|
116 |
|
117 private: |
|
118 CNifIfLink* iUmtsNif; |
|
119 CNifIfBase* iUmtsNifPppBinder; |
|
120 CProtocolPpp* iProtocolPpp; |
|
121 TBuf<KMaxLinkInterfaceName> iNifName; // Lower layer Nif name |
|
122 }; |
|
123 |
|
124 #endif |