williamr@4
|
1 |
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@4
|
2 |
// All rights reserved.
|
williamr@4
|
3 |
// This component and the accompanying materials are made available
|
williamr@4
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
williamr@4
|
5 |
// which accompanies this distribution, and is available
|
williamr@4
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@4
|
7 |
//
|
williamr@4
|
8 |
// Initial Contributors:
|
williamr@4
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@4
|
10 |
//
|
williamr@4
|
11 |
// Contributors:
|
williamr@4
|
12 |
//
|
williamr@4
|
13 |
// Description:
|
williamr@4
|
14 |
//
|
williamr@4
|
15 |
|
williamr@4
|
16 |
/**
|
williamr@4
|
17 |
@file
|
williamr@4
|
18 |
@internalComponent
|
williamr@4
|
19 |
*/
|
williamr@4
|
20 |
|
williamr@4
|
21 |
#ifndef __SS_CONNLEGACY_H__
|
williamr@4
|
22 |
#define __SS_CONNLEGACY_H__
|
williamr@4
|
23 |
|
williamr@4
|
24 |
#include <e32def.h>
|
williamr@4
|
25 |
#include <elements/factorynotify.h>
|
williamr@4
|
26 |
#include <es_sock.h> //TNifProgressBuf & co
|
williamr@4
|
27 |
#include <es_prot.h> //TConnStartType &co
|
williamr@4
|
28 |
#include <ss_std.h>
|
williamr@4
|
29 |
#include <comms-infras/ss_nodemessages_legacy.h>
|
williamr@4
|
30 |
#include <comms-infras/ss_nodemessages_legacy_internal.h>
|
williamr@4
|
31 |
#include <comms-infras/ss_legacyinterfaces.h>
|
williamr@4
|
32 |
|
williamr@4
|
33 |
class TSockOpt;
|
williamr@4
|
34 |
class CActivityTimer;
|
williamr@4
|
35 |
|
williamr@4
|
36 |
const TInt KNifEMCompatibilityLayerEntireSubConnectionUid = 0;
|
williamr@4
|
37 |
const TInt KNifEMCompatibilityLayerFakeSubConnectionId = 1;
|
williamr@4
|
38 |
|
williamr@4
|
39 |
namespace ConnStates
|
williamr@4
|
40 |
{
|
williamr@4
|
41 |
class TProcessEnumResponse;
|
williamr@4
|
42 |
class TNoTagOrCancelAllInterfaceWorker;
|
williamr@4
|
43 |
class TCancelAllInterfaceNotificationWorker;
|
williamr@4
|
44 |
}
|
williamr@4
|
45 |
|
williamr@4
|
46 |
namespace AllInterfaceNotificationActivity
|
williamr@4
|
47 |
{
|
williamr@4
|
48 |
class TEnqueueNotification;
|
williamr@4
|
49 |
class TSendErrorToConnection;
|
williamr@4
|
50 |
}
|
williamr@4
|
51 |
|
williamr@4
|
52 |
namespace EnumerateConnectionsActivity
|
williamr@4
|
53 |
{
|
williamr@4
|
54 |
class TQueryTierStatus;
|
williamr@4
|
55 |
class TCacheConnectionInfo;
|
williamr@4
|
56 |
class TCompleteClient;
|
williamr@4
|
57 |
}
|
williamr@4
|
58 |
|
williamr@4
|
59 |
namespace ESock
|
williamr@4
|
60 |
{
|
williamr@4
|
61 |
class ADataMonitoringProvider;
|
williamr@4
|
62 |
class CSubConnection;
|
williamr@4
|
63 |
class CConnManager;
|
williamr@4
|
64 |
class CConnectionProviderBase;
|
williamr@4
|
65 |
class CActivityTimer;
|
williamr@4
|
66 |
class TSelectionPrefs;
|
williamr@4
|
67 |
class TLegacyConnectionEnumRequest;
|
williamr@4
|
68 |
class CLegacySubConnectionActiveResponder;
|
williamr@4
|
69 |
|
williamr@4
|
70 |
/**
|
williamr@4
|
71 |
Server side class representing an RConnection legacy API
|
williamr@4
|
72 |
@internalComponent
|
williamr@4
|
73 |
*/
|
williamr@4
|
74 |
NONSHARABLE_CLASS(AConnectionLegacy)
|
williamr@4
|
75 |
{
|
williamr@4
|
76 |
friend class CConnection;
|
williamr@4
|
77 |
friend class CSockSession;
|
williamr@4
|
78 |
friend class Factories::TFactoryNotify<AConnectionLegacy>;
|
williamr@4
|
79 |
friend class CActivityTimer;
|
williamr@4
|
80 |
friend class ConnStates::TProcessEnumResponse;
|
williamr@4
|
81 |
friend class TLegacyConnectionEnumRequest;
|
williamr@4
|
82 |
friend class EnumerateConnectionsActivity::TQueryTierStatus;
|
williamr@4
|
83 |
friend class EnumerateConnectionsActivity::TCacheConnectionInfo;
|
williamr@4
|
84 |
friend class EnumerateConnectionsActivity::TCompleteClient;
|
williamr@4
|
85 |
friend class AllInterfaceNotificationActivity::TEnqueueNotification;
|
williamr@4
|
86 |
friend class AllInterfaceNotificationActivity::TSendErrorToConnection;
|
williamr@4
|
87 |
friend class ConnStates::TNoTagOrCancelAllInterfaceWorker;
|
williamr@4
|
88 |
friend class ConnStates::TCancelAllInterfaceNotificationWorker;
|
williamr@4
|
89 |
|
williamr@4
|
90 |
public: //So that friends of CConnection (transitions) can access it
|
williamr@4
|
91 |
void CompleteAttachL(TSelectionPrefs& aPrefs);
|
williamr@4
|
92 |
void CancelServiceChangeNotification(const Den::RSafeMessage& aMessage);
|
williamr@4
|
93 |
void SubConnectionEvent(const TSubConnectionEvent& aSubConnectionEvent);
|
williamr@4
|
94 |
|
williamr@4
|
95 |
protected:
|
williamr@4
|
96 |
AConnectionLegacy(CConnection& aConnection) :
|
williamr@4
|
97 |
iConnection(aConnection)
|
williamr@4
|
98 |
{
|
williamr@4
|
99 |
iServiceChangeNotificationPending = EFalse;
|
williamr@4
|
100 |
}
|
williamr@4
|
101 |
|
williamr@4
|
102 |
~AConnectionLegacy();
|
williamr@4
|
103 |
TInt ProcessMessageL(const RMessage2& aMessage);
|
williamr@4
|
104 |
void ReceivedL(const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aMessage); //Only called from CConnection::ReceivedL
|
williamr@4
|
105 |
|
williamr@4
|
106 |
private:
|
williamr@4
|
107 |
// Underlying implementations of individual RConnection methods
|
williamr@4
|
108 |
void StopL(const RMessage2& aMessage);
|
williamr@4
|
109 |
|
williamr@4
|
110 |
void GetIntSettingL(const Den::RSafeMessage& aMessage);
|
williamr@4
|
111 |
void GetBoolSettingL(const Den::RSafeMessage& aMessage);
|
williamr@4
|
112 |
void GetDes8SettingL(const Den::RSafeMessage& aMessage);
|
williamr@4
|
113 |
void GetDes16SettingL(const Den::RSafeMessage& aMessage);
|
williamr@4
|
114 |
void GetLongDesSettingL(const Den::RSafeMessage& aMessage);
|
williamr@4
|
115 |
void GetConnectionInfoL(const RMessage2& aMessage);
|
williamr@4
|
116 |
|
williamr@4
|
117 |
void AllInterfaceNotificationL(const RMessage2& aMessage);
|
williamr@4
|
118 |
void CompleteAllInterfaceNotificationL(TInt aError);
|
williamr@4
|
119 |
void CancelAllInterfaceNotification();
|
williamr@4
|
120 |
|
williamr@4
|
121 |
void DataTransferredL(const Den::RSafeMessage& aMessage);
|
williamr@4
|
122 |
void DataSentNotificationRequestL(const Den::RSafeMessage& aMessage);
|
williamr@4
|
123 |
void DataSentNotificationCancel(const Den::RSafeMessage& aMessage);
|
williamr@4
|
124 |
void DataReceivedNotificationRequestL(const Den::RSafeMessage& aMessage);
|
williamr@4
|
125 |
void DataReceivedNotificationCancel(const Den::RSafeMessage& aMessage);
|
williamr@4
|
126 |
void DataMonitoringNotificationRequestL(const Den::RSafeMessage& aMessage, TDataMonitoringDirection aDirection);
|
williamr@4
|
127 |
void DataMonitoringNotificationCancel(const Den::RSafeMessage& aMessage, TDataMonitoringDirection aDirection);
|
williamr@4
|
128 |
|
williamr@4
|
129 |
void IsSubConnectionActiveRequestL(const Den::RSafeMessage& aMessage);
|
williamr@4
|
130 |
void IsSubConnectionActiveCancel(const Den::RSafeMessage& aMessage);
|
williamr@4
|
131 |
|
williamr@4
|
132 |
void ExtractEnumInfoL(RBuf8& aBuffer, TUint aCount, TInt aSize, TUint aIndex, TDes8& aPckg);
|
williamr@4
|
133 |
void EnumerateConnectionClientsL();
|
williamr@4
|
134 |
void GetConnectionClientInfoL();
|
williamr@4
|
135 |
void RequestDataPlaneEnumerationL(TLegacyConnEnumClients aClientType);
|
williamr@4
|
136 |
void EnumerateConnectionSocketsL();
|
williamr@4
|
137 |
void CompleteDataPlaneEnumeration(const Messages::TNodeId& aPeer, TInt aCount, HBufC8* aInfo, TInt aError);
|
williamr@4
|
138 |
void GetConnectionSocketInfoL();
|
williamr@4
|
139 |
void ServiceChangeNotification(TUint32 aId, const TDesC& aType);
|
williamr@4
|
140 |
void FinalCompleteAllBlockedMessages(TInt aResult);
|
williamr@4
|
141 |
void CancelProviderRequests();
|
williamr@4
|
142 |
|
williamr@4
|
143 |
|
williamr@4
|
144 |
#ifndef AVAILABILITY_READY
|
williamr@4
|
145 |
void EnumerateConnectionsL(const RMessage2& aMessage);
|
williamr@4
|
146 |
#endif
|
williamr@4
|
147 |
|
williamr@4
|
148 |
// SubConnection-oriented RConnection method support
|
williamr@4
|
149 |
void EnumerateSubConnectionsL(const Den::RSafeMessage& aMessage);
|
williamr@4
|
150 |
void GetSubConnectionInfoL(const Den::RSafeMessage& aMessage);
|
williamr@4
|
151 |
|
williamr@4
|
152 |
static TBool DoesConnectionInfoExist(const TDesC8& aInfoBuf, const TConnectionClientInfo& aInfo);
|
williamr@4
|
153 |
protected:
|
williamr@4
|
154 |
ADataMonitoringProvider* FetchConnDataMonitoringProvider() const;
|
williamr@4
|
155 |
ADataMonitoringProvider* FetchSubConnDataMonitoringProvider() const;
|
williamr@4
|
156 |
|
williamr@4
|
157 |
//global notifications
|
williamr@4
|
158 |
void InterfaceStateChangeNotification(TDesC8& aInfo);
|
williamr@4
|
159 |
void RequestServiceChangeNotificationL(const Den::RSafeMessage& aMessage);
|
williamr@4
|
160 |
void ControlL(TUint aOptionName, TUint aMessageId);
|
williamr@4
|
161 |
|
williamr@4
|
162 |
// Underlying implementations of individual RConnection methods relating to subconnections
|
williamr@4
|
163 |
void AllSubConnectionNotificationL();
|
williamr@4
|
164 |
void CancelAllSubConnectionNotification();
|
williamr@4
|
165 |
|
williamr@4
|
166 |
private:
|
williamr@4
|
167 |
RMessage2 iAllSubConnectionNotificationMessage;
|
williamr@4
|
168 |
|
williamr@4
|
169 |
TInterfaceChangeQueue iInterfaceChangeQueue; // queue of interface notifications received
|
williamr@4
|
170 |
|
williamr@4
|
171 |
TUint iConnectionInfoCount;
|
williamr@4
|
172 |
TUint iConnectionClientCount;
|
williamr@4
|
173 |
RBuf8 iConnectionClientBuf;
|
williamr@4
|
174 |
TUint iConnectionSocketCount;
|
williamr@4
|
175 |
RBuf8 iConnectionSocketBuf;
|
williamr@4
|
176 |
Den::RSafeMessage iEnumConnMsg; //< During a Data plane enum holds blocked client msg
|
williamr@4
|
177 |
TUint* iDPEnumCount; //< During a Data plane enum points to count recipient
|
williamr@4
|
178 |
RBuf8* iDPEnumBuf; //< During a Data plane enum points to data buf
|
williamr@4
|
179 |
RArray<Messages::TNodeId> iEnumConnSockCandidateSCPRs; //< During a Data plane enum is list of SCPRs for connection
|
williamr@4
|
180 |
|
williamr@4
|
181 |
RMessage2* iMessage; //current message valid only within ProcessMessageL call
|
williamr@4
|
182 |
CConnection& iConnection;
|
williamr@4
|
183 |
|
williamr@4
|
184 |
RPointerArray<CSubConnection> iSubConnections; //client classes servicing sub-connection
|
williamr@4
|
185 |
//related functionality requested via legacy RConnection API. sub-connections
|
williamr@4
|
186 |
//objects are owned by AConnectionLegacy instance and don't have RSubConnection
|
williamr@4
|
187 |
//client side.
|
williamr@4
|
188 |
CConnManager* iConnManager; //client class servicing connection manager
|
williamr@4
|
189 |
//related functionality requested via legacy RConnection API. CConnManager
|
williamr@4
|
190 |
//object is owned by AConnectionLegacy instance and does't have RConnManager
|
williamr@4
|
191 |
//client side.
|
williamr@4
|
192 |
// Flags for pending RConnection requests
|
williamr@4
|
193 |
TBool iServiceChangeNotificationPending;
|
williamr@4
|
194 |
|
williamr@4
|
195 |
// IsSubConnectionActive support
|
williamr@4
|
196 |
ADataMonitoringProvider* iConnActivityDataMonProv;
|
williamr@4
|
197 |
ESock::CActivityTimer* iActivityTimer;
|
williamr@4
|
198 |
TBool iClientsSubConnectionActiveState;
|
williamr@4
|
199 |
TUint iInitialSentDataVolume;
|
williamr@4
|
200 |
TUint iInitialReceivedDataVolume;
|
williamr@4
|
201 |
TUint iRequestedClientActivityTimerPeriod;
|
williamr@4
|
202 |
TBool iOutstandingIsSubConnectionActiveRequest;
|
williamr@4
|
203 |
RMessage2 iOutstandingIsSubConnectionActiveMessage;
|
williamr@4
|
204 |
|
williamr@4
|
205 |
TBool iDeferredSubConnectionNotificationEnable;
|
williamr@4
|
206 |
TSubConnectionEventQueue iSubConnectionEventQueue; // queue of subconnection events received
|
williamr@4
|
207 |
|
williamr@4
|
208 |
// EnumerateConnection and GetConnectionInfo use this.
|
williamr@4
|
209 |
RPointerArray<TSourcedConnectionInfo> iConnectionInfoPtrArray;
|
williamr@4
|
210 |
|
williamr@4
|
211 |
// AllInterfaceNotification support
|
williamr@4
|
212 |
RMessage2 iAllInterfaceNotificationMessage;
|
williamr@4
|
213 |
TInterfaceChangeQueue iNotificationQueue;
|
williamr@4
|
214 |
Messages::TNodeId iAllInterfaceNotificationWorker;
|
williamr@4
|
215 |
|
williamr@4
|
216 |
protected:
|
williamr@4
|
217 |
static const TAnyFn iInterfaceVTableF[];
|
williamr@4
|
218 |
};
|
williamr@4
|
219 |
|
williamr@4
|
220 |
|
williamr@4
|
221 |
} //namespace ESock
|
williamr@4
|
222 |
|
williamr@4
|
223 |
#endif
|
williamr@4
|
224 |
// __SS_CONNLEGACY_H__
|
williamr@4
|
225 |
|