|
1 // Copyright (c) 2007-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 #ifndef __GUQOS_H__ |
|
17 #define __GUQOS_H__ |
|
18 |
|
19 |
|
20 #include <e32base.h> |
|
21 #include <e32std.h> |
|
22 |
|
23 #include <networking/module_if.h> |
|
24 |
|
25 class CFlowData; |
|
26 class CFlowContext; |
|
27 class TQoSRequested; |
|
28 |
|
29 const TUint KModuleGUQoS = 0x168; |
|
30 |
|
31 const TUint KGUQoSPriority = 10; |
|
32 const TUint KModuleCapabilites = KQoSModuleBindToInterface | |
|
33 KQoSModuleScheduler | |
|
34 KQoSModulePolicer | |
|
35 KQoSModuleShaper | |
|
36 KQoSModuleSerialize | |
|
37 KQoSFatalFailure | |
|
38 KQoSModulePartialSignaling; |
|
39 |
|
40 |
|
41 const TUint KPdpContextDeleteTimeout = 6000000; |
|
42 |
|
43 // |
|
44 // Configurable options |
|
45 class TConfigurableOptions |
|
46 { |
|
47 public: |
|
48 TInt iTimeout; // Delay for Pdp context deletion [unit: seconds] |
|
49 }; |
|
50 |
|
51 |
|
52 const TUint KMajorVersionNumber=0; |
|
53 const TUint KMinorVersionNumber=1; |
|
54 const TUint KBuildVersionNumber=1; |
|
55 |
|
56 // Forward decls |
|
57 class CNif; |
|
58 class CPdpContext; |
|
59 class CNifManager; |
|
60 class MTimeoutManager; |
|
61 |
|
62 class CModuleGuqos : public CModuleBase |
|
63 { |
|
64 public: |
|
65 static CModuleGuqos* NewL(); |
|
66 ~CModuleGuqos(); |
|
67 |
|
68 void InitModuleL(MEventInterface& aEventInterface, CExtension* aData); |
|
69 void OpenL(CFlowContext &aFlow, CNifIfBase* aIf); |
|
70 void Close(CFlowContext &aFlow); |
|
71 void Negotiate(CFlowContext &aFlow, const TQoSParameters& aParams, MQoSNegotiateEvent& aNotify); |
|
72 void Release(CFlowContext &aFlow); |
|
73 void OpenChannel(TInt aChannelId, const TQoSParameters& aParams, CExtensionPolicy& aPolicy, MQoSNegotiateEvent& aNotify, CFlowContext& aFlow); |
|
74 void CloseChannel(TInt aChannelId); |
|
75 void NegotiateChannel(TInt aChannelId, const TQoSParameters& aParams, CExtensionPolicy& aPolicy, MQoSNegotiateEvent& aNotify); |
|
76 void Join(TInt aChannelId, CFlowContext& aFlow, MQoSNegotiateEvent& aNotify); |
|
77 void Leave(TInt aChannelId, CFlowContext& aFlow, MQoSNegotiateEvent& aNotify); |
|
78 TInt Configure(TUint aLevel, TUint aName, TDes8& aOption, TAny* aSource=0); |
|
79 void Identify(TServerProtocolDesc* aProtocolDesc)const; |
|
80 //lint -e{1411} It doesn't matter that CProtocolBase:Identify() looks similar |
|
81 static void Identify(TServerProtocolDesc& aDesc); |
|
82 TInt Send(RMBufChain& buf, CProtocolBase* aSourceProtocol=NULL); |
|
83 void InterfaceAttached(const TDesC& aName, CNifIfBase *aIf); |
|
84 void InterfaceDetached(const TDesC& aName, CNifIfBase *aIf); |
|
85 void Unbind(CProtocolBase* aProtocol, TUint aId = 0); |
|
86 |
|
87 TInt GetDefaultParameters(TQoSRequested& aParameters, TUint32 aIapId); |
|
88 CFlowData* FindFlow(const CFlowContext* aFlow); |
|
89 |
|
90 inline CNifManager* IfManager(); |
|
91 inline MEventInterface* QoSEvent(); |
|
92 inline TUint FlowCount() const; |
|
93 inline MTimeoutManager* TimeoutManager() const; |
|
94 inline const TConfigurableOptions& Options() const; |
|
95 |
|
96 protected: |
|
97 CModuleGuqos(); |
|
98 void ConstructL(); |
|
99 |
|
100 private: |
|
101 MEventInterface *iNotify; |
|
102 |
|
103 CFlowData* NewFlowL(CFlowContext& aFlow, CNif& aNif); |
|
104 void ReadConfigOptions(); |
|
105 |
|
106 private: |
|
107 TConfigurableOptions iOptions; // Ini options. |
|
108 TUint iFlowCount; |
|
109 CNifManager* iIfManager; // interface manager |
|
110 MTimeoutManager* iTimeoutManager; // Timeout manager |
|
111 CFlowData* iList; // All flows. |
|
112 }; |
|
113 |
|
114 |
|
115 // Inline methods |
|
116 inline CNifManager* CModuleGuqos::IfManager() |
|
117 { return iIfManager; }; |
|
118 |
|
119 inline MEventInterface* CModuleGuqos::QoSEvent() |
|
120 { return iNotify; } |
|
121 |
|
122 inline TUint CModuleGuqos::FlowCount() const |
|
123 { return iFlowCount;}; |
|
124 |
|
125 inline MTimeoutManager* CModuleGuqos::TimeoutManager() const |
|
126 { return iTimeoutManager; } |
|
127 |
|
128 inline const TConfigurableOptions& CModuleGuqos::Options() const |
|
129 { return iOptions; } |
|
130 |
|
131 typedef TSglQueIter<CNif> TNifIter; |
|
132 |
|
133 #endif |