|
1 /** |
|
2 * Copyright (c) 2005-2009 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: |
|
15 * Header file for the IP SubConnection Provider and its basic version |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 /** |
|
23 @file ipscpr.h |
|
24 */ |
|
25 |
|
26 #ifndef __IPSCPR_H__ |
|
27 #define __IPSCPR_H__ |
|
28 |
|
29 #include <e32base.h> |
|
30 #include <e32std.h> |
|
31 #include <ss_subconnprov.h> |
|
32 #include "deft_scpr.h" |
|
33 #include <eintsock.h> |
|
34 #include <in_sock.h> |
|
35 #include <es_sock.h> |
|
36 |
|
37 |
|
38 #ifndef BASIC_IPSCPR |
|
39 #include "asyncwriter.h" |
|
40 #include <qoslib.h> |
|
41 #include <ip_subconparams.h> |
|
42 |
|
43 #ifdef SYMBIAN_NETWORKING_UMTSR5 |
|
44 #include <umtsextn.h> |
|
45 #include <imsextn.h> |
|
46 #endif |
|
47 #endif |
|
48 |
|
49 |
|
50 /** |
|
51 Connection Provider Id - Protocol Family |
|
52 |
|
53 @internalComponent |
|
54 |
|
55 @released Since v9.0 |
|
56 */ |
|
57 const TUint KIPConnectionProviderFactoryId = KAfInet; |
|
58 |
|
59 /** |
|
60 ECOM Implementation Id for Connection Provider |
|
61 |
|
62 @internalComponent |
|
63 |
|
64 @released Since v9.0 |
|
65 */ |
|
66 #ifdef BASIC_IPSCPR |
|
67 const TInt KSubConnectionProviderImplementationUid = { 0x102752C5 }; |
|
68 #else |
|
69 const TInt KSubConnectionProviderImplementationUid = { 0x10204308 }; |
|
70 #endif |
|
71 |
|
72 |
|
73 class CConnectionProviderBase; |
|
74 class CIpSubConnectionProviderFactory : public CSubConnectionProviderFactoryBase |
|
75 /** |
|
76 Factory that is used to create instances of IP Connection Providers |
|
77 |
|
78 @internalComponent |
|
79 |
|
80 @released Since v9.0 |
|
81 */ |
|
82 { |
|
83 public: |
|
84 static CIpSubConnectionProviderFactory* NewL(TAny* aConstructionParameters); |
|
85 virtual ~CIpSubConnectionProviderFactory(); |
|
86 |
|
87 CIpSubConnectionProviderFactory(TUint aFactoryId, CSubConnectionFactoryContainer& aParentContainer); |
|
88 |
|
89 // methods to be overriden for CSubConnectionProviderFactory |
|
90 virtual CSubConnectionProviderBase* DoCreateProviderL(CConnectionProviderBase& aConnProvider, RSubConnection::TSubConnType aType); |
|
91 }; |
|
92 |
|
93 |
|
94 #ifndef BASIC_IPSCPR |
|
95 |
|
96 class CQoSMsgWriter; |
|
97 class CQoSMsgReader; |
|
98 class TPfqosMessage; |
|
99 class CSubConGenEventParamsGranted; |
|
100 class CSubConQosGenericParamSet; |
|
101 class CSubConQosIPLinkR99ParamSet; |
|
102 class CSubConSBLPR5ExtensionParamSet; |
|
103 class CSblpParameters; |
|
104 class TQoSParameters; |
|
105 class TUmtsQoSParameters; |
|
106 |
|
107 |
|
108 #ifdef SYMBIAN_NETWORKING_UMTSR5 |
|
109 class TUmtsR5QoSParameters; |
|
110 class TImsParameter; |
|
111 class CSubConQosR5ParamSet; |
|
112 class CSubConIMSExtParamSet; |
|
113 #endif |
|
114 // SYMBIAN_NETWORKING_UMTSR5 |
|
115 |
|
116 |
|
117 class CIpSubConnectionProvider : public CEmptySubConnectionProvider |
|
118 /** |
|
119 Defines the IP Connection Provider. Class provides a mapping from ESock Subconnection |
|
120 function calls to QoS.PRT messages. |
|
121 |
|
122 @internalComponent |
|
123 |
|
124 @released Since v9.0 |
|
125 */ |
|
126 { |
|
127 private: |
|
128 enum |
|
129 { |
|
130 KParameterRelInvalid = 0, |
|
131 KParameterRelGeneric = 1, |
|
132 KParameterRel4Rel99 = 4, |
|
133 KParameterRel5 = 5, |
|
134 }; |
|
135 |
|
136 public: |
|
137 // Construction |
|
138 static CIpSubConnectionProvider* NewL(CIpSubConnectionProviderFactory& aFactory, CConnectionProviderBase& aConnProvider); |
|
139 |
|
140 protected: |
|
141 // Construction |
|
142 CIpSubConnectionProvider(CIpSubConnectionProviderFactory& aFactory, CConnectionProviderBase& aConnProvider); |
|
143 |
|
144 // Methods to be overriden be derived subconnection provider |
|
145 virtual void DoDataClientJoiningL(MSubConnectionDataClient& aDataClient); |
|
146 virtual void DoDataClientLeaving(MSubConnectionDataClient& aDataClient); |
|
147 virtual void DoSourceAddressUpdate(MSubConnectionDataClient& aDataClient, const TSockAddr& aSource); |
|
148 virtual void DoDestinationAddressUpdate(MSubConnectionDataClient& aDataClient, const TSockAddr& aDestination); |
|
149 virtual void DoDataClientRouted(MSubConnectionDataClient& aDataClient, const TSockAddr& aSource, const TSockAddr& aDestination, const TDesC8& aConnectionInfo); |
|
150 virtual void DoParametersAboutToBeSetL(CSubConParameterBundle& aParameterBundle); |
|
151 virtual TInt DoControl(TUint aOptionLevel, TUint aOptionName, TDes8& aOption); |
|
152 |
|
153 virtual void DoStartL(); |
|
154 virtual void DoStop(); |
|
155 virtual CSubConnectionProviderBase* DoNextLayer(); |
|
156 virtual CConnDataTransfer& DoDataTransferL(); |
|
157 |
|
158 //MConnectionDataClient |
|
159 virtual TAny* FetchInterfaceInstanceL(CSubConnectionProviderBase& aProvider, const STypeId& aTid); |
|
160 virtual void ConnectionGoingDown(CConnectionProviderBase& aConnProvider); |
|
161 virtual void Notify(TNotify aNotifyType, CConnectionProviderBase* aConnProvider, TInt aError, const CConNotificationEvent* aConNotificationEvent); |
|
162 virtual void AttachToNext(CSubConnectionProviderBase* aSubConnProvider); |
|
163 |
|
164 // Don't allow clients to invoke the destructor. |
|
165 // (Only the CCommsFactoryBase should do this) |
|
166 virtual ~CIpSubConnectionProvider(); |
|
167 |
|
168 void ConstructL(); |
|
169 |
|
170 public: |
|
171 // Messages from PRT |
|
172 void ProcessPRTMsg(TPfqosMessage& aMsg); |
|
173 void ProcessPRTError(TPfqosMessage& aMsg, TInt aError); |
|
174 #ifdef _DEBUG |
|
175 void ProcessPRTError(TInt aMsgType, TInt aError); |
|
176 #endif |
|
177 |
|
178 private: |
|
179 // Messages to PRT |
|
180 void SendOpenExistingL(const TInetAddr &aSrcAddr, const TInetAddr &aDstAddr, TUint32 aIapId, TUint32 aProtocol); |
|
181 void SendCreateL(const TInetAddr &aSrcAddr, const TInetAddr &aDstAddr, TUint32 aIapId, TUint32 aProtocol); |
|
182 void SendCloseL(); |
|
183 void SendJoinL(const TInetAddr &aSrcAddr, const TInetAddr &aDstAddr, TUint32 aIapId, TUint32 aProtocol); |
|
184 void SendLeaveL(const TInetAddr &aSrcAddr, const TInetAddr &aDstAddr, TUint32 aIapId, TUint32 aProtocol); |
|
185 void SendSetQoSL(); |
|
186 |
|
187 // Internal Processing |
|
188 void ProcessPRTEventL(TPfqosMessage& aMsg); |
|
189 void ProcessPRTReplyL(TPfqosMessage& aMsg); |
|
190 |
|
191 void ConvertParametersFromESockL(CSubConParameterBundle& aParameterBundle); |
|
192 void ConvertParametersFromQOSL(TPfqosMessage& aMsg, CSubConGenEventParamsGranted* aEvent); |
|
193 |
|
194 TInt DetermineClient(const TPfqosMessage& aMsg, MSubConnectionDataClient*& aDataClient); |
|
195 void MapGenericParamsFromESockToPRTL(const CSubConQosGenericParamSet& generic) const; |
|
196 void MapGenericParamsFromPRTToESockL(CSubConQosGenericParamSet& generic) const; |
|
197 void MapExtensionParamsFromESockToPRTL(const CSubConQosIPLinkR99ParamSet& extension, TUmtsQoSParameters& params); |
|
198 |
|
199 void ResetPrtExtensions(); |
|
200 |
|
201 |
|
202 #ifdef SYMBIAN_NETWORKING_UMTSR5 |
|
203 void MapExtensionParamsFromESockToPRTL(const CSubConQosR5ParamSet& aExtension, TUmtsR5QoSParameters& aParams); |
|
204 void MapExtensionParamsFromESockToPRTL(const CSubConImsExtParamSet& aExtension, TImsParameter& aParams); |
|
205 |
|
206 CSubConExtensionParameterSet* MapFromUmtsR5ExtensionL (const CUmtsR5QoSPolicy* aPolicy); |
|
207 CSubConExtensionParameterSet* MapFromImsExtensionL (const CImsPolicy* aPolicy); |
|
208 #endif |
|
209 // SYMBIAN_NETWORKING_UMTSR5 |
|
210 |
|
211 |
|
212 void MapExtensionParamsFromESockToPRTL(const CSubConSBLPR5ExtensionParamSet& extension, CSblpParameters& params) const; |
|
213 |
|
214 void ConvertTQoSIntoCQoSParamsL(const TQoSParameters& aParameter); |
|
215 void ConvertCQoSIntoTQoSParamsL(TQoSParameters& aParameters) const; |
|
216 |
|
217 private: |
|
218 /** Internal Socket */ |
|
219 RInternalSocket iSocket; |
|
220 |
|
221 /** PRT message writer */ |
|
222 CQoSMsgWriter* iWriter; |
|
223 |
|
224 /** PRT message reader */ |
|
225 CQoSMsgReader* iReader; |
|
226 |
|
227 /** QoS channel Id */ |
|
228 TInt iChannelId; |
|
229 |
|
230 /** Process UID */ |
|
231 TUidType iUid; |
|
232 |
|
233 /** QoS Parameters */ |
|
234 CQoSParameters* iPrtParameters; |
|
235 |
|
236 /** QoS Extensions */ |
|
237 TQoSExtensionQueue iPrtExtensions; |
|
238 |
|
239 /** QoS Parameters Set */ |
|
240 TBool iParametersSet; |
|
241 TInt iParameterRelease; |
|
242 |
|
243 /**Class for doing async writes */ |
|
244 CAsyncWriter* iAsyncWriter; |
|
245 }; |
|
246 |
|
247 #endif // BASIC_IPSCPR |
|
248 #endif // __IPSCPR_H__ |
|
249 |