williamr@2
|
1 |
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@2
|
4 |
// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@2
|
6 |
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
//
|
williamr@2
|
15 |
|
williamr@2
|
16 |
|
williamr@2
|
17 |
|
williamr@2
|
18 |
/**
|
williamr@2
|
19 |
@file
|
williamr@2
|
20 |
@publishedAll
|
williamr@2
|
21 |
@released
|
williamr@2
|
22 |
*/
|
williamr@2
|
23 |
|
williamr@2
|
24 |
#if !defined(__ES_SOCK_H__)
|
williamr@2
|
25 |
#define __ES_SOCK_H__
|
williamr@2
|
26 |
|
williamr@2
|
27 |
|
williamr@2
|
28 |
#include <e32base.h>
|
williamr@2
|
29 |
#include <nifvar.h>
|
williamr@2
|
30 |
|
williamr@2
|
31 |
#undef _DEBUG_SOCKET_FUNCTIONS
|
williamr@2
|
32 |
#if defined(_DEBUG)
|
williamr@2
|
33 |
#define _DEBUG_SOCKET_FUNCTIONS
|
williamr@2
|
34 |
#endif
|
williamr@2
|
35 |
|
williamr@2
|
36 |
#include <comms-infras/metacontainer.h>
|
williamr@2
|
37 |
using Meta::STypeId;
|
williamr@2
|
38 |
using Meta::SMetaDataECom;
|
williamr@2
|
39 |
using Meta::RMetaDataEComContainer;
|
williamr@2
|
40 |
|
williamr@2
|
41 |
|
williamr@2
|
42 |
// Forward declaration of CCommsDataObjectBase
|
williamr@2
|
43 |
namespace ESock
|
williamr@2
|
44 |
{
|
williamr@2
|
45 |
class CCommsDataObjectBase;
|
williamr@2
|
46 |
}
|
williamr@2
|
47 |
|
williamr@2
|
48 |
/**
|
williamr@2
|
49 |
Name of ESock server in EKA2
|
williamr@2
|
50 |
@internalComponent
|
williamr@2
|
51 |
*/
|
williamr@2
|
52 |
_LIT(SOCKET_SERVER_NAME, "!SocketServer");
|
williamr@2
|
53 |
|
williamr@2
|
54 |
/**
|
williamr@2
|
55 |
Canonical names for the core ESOCKSVR modules
|
williamr@2
|
56 |
*/
|
williamr@2
|
57 |
_LIT8(SOCKET_SERVER_MAIN_MODULE_NAME, "ESock_Main"); // Worker 0
|
williamr@2
|
58 |
_LIT8(SOCKET_SERVER_IP_MODULE_NAME, "ESock_IP"); // Worker 1
|
williamr@2
|
59 |
_LIT8(SOCKET_SERVER_BT_MODULE_NAME, "ESock_Bt"); // Worker 2
|
williamr@2
|
60 |
_LIT8(SOCKET_SERVER_IR_MODULE_NAME, "ESock_Ir"); // Worker 3
|
williamr@2
|
61 |
_LIT8(SOCKET_SERVER_SMSWAP_MODULE_NAME, "ESock_SmsWap"); // Worker 4
|
williamr@2
|
62 |
|
williamr@2
|
63 |
/**
|
williamr@2
|
64 |
Id of the network layer.
|
williamr@2
|
65 |
@publishedPartner
|
williamr@2
|
66 |
*/
|
williamr@2
|
67 |
const TUint KCommsNetworkLayerId = 1;
|
williamr@2
|
68 |
|
williamr@2
|
69 |
/**
|
williamr@2
|
70 |
Default number of message slots.
|
williamr@2
|
71 |
@publishedAll
|
williamr@2
|
72 |
@released
|
williamr@2
|
73 |
*/
|
williamr@2
|
74 |
const TUint KESockDefaultMessageSlots=8;
|
williamr@2
|
75 |
|
williamr@2
|
76 |
/**
|
williamr@2
|
77 |
Major Version Number of Connection
|
williamr@2
|
78 |
|
williamr@2
|
79 |
@internalComponent
|
williamr@2
|
80 |
*/
|
williamr@2
|
81 |
const TUint KConnectionMajorVersionNumber=1;
|
williamr@2
|
82 |
|
williamr@2
|
83 |
/**
|
williamr@2
|
84 |
Minor Version Number of Connection
|
williamr@2
|
85 |
|
williamr@2
|
86 |
@internalComponent
|
williamr@2
|
87 |
*/
|
williamr@2
|
88 |
const TUint KConnectionMinorVersionNumber=0;
|
williamr@2
|
89 |
|
williamr@2
|
90 |
/**
|
williamr@2
|
91 |
Build Version Number of Connection
|
williamr@2
|
92 |
this must not be changed - expected by TCPIP to be >=68
|
williamr@2
|
93 |
|
williamr@2
|
94 |
@internalComponent
|
williamr@2
|
95 |
*/
|
williamr@2
|
96 |
const TUint KConnectionBuildVersionNumber=68;
|
williamr@2
|
97 |
|
williamr@2
|
98 |
/**
|
williamr@2
|
99 |
Size of Maximum SubConnection event
|
williamr@2
|
100 |
|
williamr@2
|
101 |
@internalComponent
|
williamr@2
|
102 |
@note If you allocate this on the heap, remember to delete through the pointer to the buffer and not any pointers to the events held inside it
|
williamr@2
|
103 |
if you change this value, you will alter the function signature and break the .def file
|
williamr@2
|
104 |
*/
|
williamr@2
|
105 |
const TUint KMaxSubConnectionEventSize = 512;
|
williamr@2
|
106 |
|
williamr@2
|
107 |
/**
|
williamr@2
|
108 |
SubConnection Unique Id
|
williamr@2
|
109 |
@publishedPartner
|
williamr@2
|
110 |
@released
|
williamr@2
|
111 |
*/
|
williamr@2
|
112 |
typedef TUint TSubConnectionUniqueId;
|
williamr@2
|
113 |
|
williamr@2
|
114 |
/**
|
williamr@2
|
115 |
Buffer for notification of any change in the state of SubConnection.
|
williamr@2
|
116 |
@publishedPartner
|
williamr@2
|
117 |
@released
|
williamr@2
|
118 |
*/
|
williamr@2
|
119 |
typedef TBuf8<KMaxSubConnectionEventSize> TSubConnectionNotificationBuf;
|
williamr@2
|
120 |
//
|
williamr@2
|
121 |
const TUint KUseEmbeddedUniqueId = 0; ///< Used by RConnection to identify cases where the subconnection id is embedded in the data structure
|
williamr@2
|
122 |
|
williamr@2
|
123 |
const TUint KConnProgressDefault = 0; ///< Default Connection Progress
|
williamr@2
|
124 |
|
williamr@2
|
125 |
class TSessionPref
|
williamr@2
|
126 |
/**
|
williamr@2
|
127 |
Hint to the Socket Server on what will be the principal usage of the connection.
|
williamr@2
|
128 |
It is by no means a restriction but may result in better performance for the session.
|
williamr@2
|
129 |
|
williamr@2
|
130 |
@publishedAll
|
williamr@2
|
131 |
@released
|
williamr@2
|
132 |
*/
|
williamr@2
|
133 |
{
|
williamr@2
|
134 |
public:
|
williamr@2
|
135 |
IMPORT_C TSessionPref();
|
williamr@2
|
136 |
public:
|
williamr@2
|
137 |
/** The protocol's address family. For example, for TCP/IP protocols, KAfInet. */
|
williamr@2
|
138 |
TUint iAddrFamily;
|
williamr@2
|
139 |
/** The protocol type. */
|
williamr@2
|
140 |
TUint iProtocol;
|
williamr@2
|
141 |
/** Reserved. */
|
williamr@2
|
142 |
TUint iReserved;
|
williamr@2
|
143 |
/** Reserved. */
|
williamr@2
|
144 |
TUint iReserved1;
|
williamr@2
|
145 |
/** Reserved. */
|
williamr@2
|
146 |
TUint iReserved2;
|
williamr@2
|
147 |
/** Reserved. */
|
williamr@2
|
148 |
TUint iReserved3;
|
williamr@2
|
149 |
/** Reserved. */
|
williamr@2
|
150 |
TUint iReserved4;
|
williamr@2
|
151 |
};
|
williamr@2
|
152 |
|
williamr@2
|
153 |
class TNifProgress
|
williamr@2
|
154 |
/**
|
williamr@2
|
155 |
Contains progress information on a dial-up connection
|
williamr@2
|
156 |
|
williamr@2
|
157 |
@publishedAll
|
williamr@2
|
158 |
@released
|
williamr@2
|
159 |
*/
|
williamr@2
|
160 |
{
|
williamr@2
|
161 |
public:
|
williamr@2
|
162 |
inline TNifProgress();
|
williamr@2
|
163 |
TInt iStage;
|
williamr@2
|
164 |
TInt iError;
|
williamr@2
|
165 |
};
|
williamr@2
|
166 |
|
williamr@2
|
167 |
class TNifAgentInfo
|
williamr@2
|
168 |
/**
|
williamr@2
|
169 |
Contains information describing an agent
|
williamr@2
|
170 |
|
williamr@2
|
171 |
@publishedAll
|
williamr@2
|
172 |
@released
|
williamr@2
|
173 |
*/
|
williamr@2
|
174 |
{
|
williamr@2
|
175 |
public:
|
williamr@2
|
176 |
/** This class Contains version information */
|
williamr@2
|
177 |
TVersion iVersion;
|
williamr@2
|
178 |
|
williamr@2
|
179 |
/** This class Defines a modifiable buffer descriptor that can contain the name of a reference counting object */
|
williamr@2
|
180 |
TName iName;
|
williamr@2
|
181 |
};
|
williamr@2
|
182 |
|
williamr@2
|
183 |
/**
|
williamr@2
|
184 |
Buffer for Network Interface Progress
|
williamr@2
|
185 |
|
williamr@2
|
186 |
@publishedAll
|
williamr@2
|
187 |
@released
|
williamr@2
|
188 |
*/
|
williamr@2
|
189 |
typedef TPckgBuf<TNifProgress> TNifProgressBuf;
|
williamr@2
|
190 |
|
williamr@2
|
191 |
/**
|
williamr@2
|
192 |
Socket address offsets.
|
williamr@2
|
193 |
|
williamr@2
|
194 |
@publishedAll
|
williamr@2
|
195 |
@released
|
williamr@2
|
196 |
*/
|
williamr@2
|
197 |
struct SSockAddr
|
williamr@2
|
198 |
/** Socket address offsets.
|
williamr@2
|
199 |
|
williamr@2
|
200 |
This class defines the internal offsets of data members for the TSockAddr
|
williamr@2
|
201 |
class. */
|
williamr@2
|
202 |
{
|
williamr@2
|
203 |
/** Address family of socket address */
|
williamr@2
|
204 |
TUint iFamily;
|
williamr@2
|
205 |
/** Port (or equivilent) number */
|
williamr@2
|
206 |
TUint iPort;
|
williamr@2
|
207 |
};
|
williamr@2
|
208 |
|
williamr@2
|
209 |
/**
|
williamr@2
|
210 |
Maximum sockets address size.
|
williamr@2
|
211 |
@publishedAll
|
williamr@2
|
212 |
@released
|
williamr@2
|
213 |
*/
|
williamr@2
|
214 |
const TUint KMaxSockAddrSize=0x20;
|
williamr@2
|
215 |
|
williamr@2
|
216 |
class TSockAddr : public TBuf8<KMaxSockAddrSize>
|
williamr@2
|
217 |
/** Represents an end point address.
|
williamr@2
|
218 |
|
williamr@2
|
219 |
Protocols interpret the class within the socket server to route packets and
|
williamr@2
|
220 |
form connections. It can be used on its own or as derived by protocols. The
|
williamr@2
|
221 |
SSockAddr class acts as an offset map for the TSockAddr class which has a
|
williamr@2
|
222 |
family field and a port field. The family field may be used by protocols to
|
williamr@2
|
223 |
"up-cast" the base-class to the correct derived class. The port field is provided
|
williamr@2
|
224 |
because it is a common practice for protocols to use port equivalents in addressing.
|
williamr@2
|
225 |
|
williamr@2
|
226 |
Writing derived classes:
|
williamr@2
|
227 |
|
williamr@2
|
228 |
The two protected member functions allow further data members to be defined
|
williamr@2
|
229 |
past the area of the base SSockAddr. In any derived constructor the length
|
williamr@2
|
230 |
of the descriptor should be set to the length of the valid data contained
|
williamr@2
|
231 |
in the address. Subsequent member function calls should also adjust the length
|
williamr@2
|
232 |
if it affects valid data.
|
williamr@2
|
233 |
@publishedAll
|
williamr@2
|
234 |
@released */
|
williamr@2
|
235 |
{
|
williamr@2
|
236 |
public:
|
williamr@2
|
237 |
IMPORT_C TSockAddr();
|
williamr@2
|
238 |
IMPORT_C TSockAddr(TUint aFamily);
|
williamr@2
|
239 |
IMPORT_C TUint Family() const;
|
williamr@2
|
240 |
IMPORT_C void SetFamily(TUint aFamily);
|
williamr@2
|
241 |
IMPORT_C TUint Port() const;
|
williamr@2
|
242 |
IMPORT_C void SetPort(TUint aPort);
|
williamr@2
|
243 |
IMPORT_C TBool CmpPort(const TSockAddr& anAddr) const;
|
williamr@2
|
244 |
IMPORT_C TInt GetUserLen();
|
williamr@2
|
245 |
protected:
|
williamr@2
|
246 |
IMPORT_C void SetUserLen(TInt aLen);
|
williamr@2
|
247 |
inline TUint8* UserPtr() const;
|
williamr@2
|
248 |
private:
|
williamr@2
|
249 |
inline SSockAddr* BasePtr() const;
|
williamr@2
|
250 |
};
|
williamr@2
|
251 |
|
williamr@2
|
252 |
// Address families (based upon protocol IDs used by ARP/REVARP)
|
williamr@2
|
253 |
/** Default (unspecified) protocol module.
|
williamr@2
|
254 |
@publishedAll
|
williamr@2
|
255 |
@released */
|
williamr@2
|
256 |
const TUint KAFUnspec=0;
|
williamr@2
|
257 |
|
williamr@2
|
258 |
// Socket types
|
williamr@2
|
259 |
/** Stream socket.
|
williamr@2
|
260 |
@publishedAll
|
williamr@2
|
261 |
@released */
|
williamr@2
|
262 |
const TUint KSockStream=1;
|
williamr@2
|
263 |
/** Datagram socket. */
|
williamr@2
|
264 |
const TUint KSockDatagram=2;
|
williamr@2
|
265 |
/** Datagrams with sequence numbers. */
|
williamr@2
|
266 |
const TUint KSockSeqPacket=3;
|
williamr@2
|
267 |
/** Raw socket. */
|
williamr@2
|
268 |
const TUint KSockRaw=4;
|
williamr@2
|
269 |
|
williamr@2
|
270 |
// constants for various socket calls - can't be enums cos they're largely defined by protocols
|
williamr@2
|
271 |
// The following constants are used to define level parameters for RSocket::Ioctl(), RSocket::GetOpt()
|
williamr@2
|
272 |
// and RSocket::SetOpt().
|
williamr@2
|
273 |
/** Generic socket options/commands.
|
williamr@2
|
274 |
@publishedAll
|
williamr@2
|
275 |
@released */
|
williamr@2
|
276 |
const TInt KSOLSocket=1;
|
williamr@2
|
277 |
/** Unspecified level. */
|
williamr@2
|
278 |
const TInt KLevelUnspecified=0;
|
williamr@2
|
279 |
|
williamr@2
|
280 |
// Socket options defined by the server.
|
williamr@2
|
281 |
// Used through RSocket::SetOpt(), and RSocket::GetOpt() with anOptionLevel set
|
williamr@2
|
282 |
// to KSOLSocket. Options can be both get and set unless otherwise.
|
williamr@2
|
283 |
// stated.
|
williamr@2
|
284 |
// Notes:
|
williamr@2
|
285 |
// Setting the send and receive buffer sizes explicitly can help to reduce
|
williamr@2
|
286 |
// the memory requirements if many data sockets are used in an application. If a
|
williamr@2
|
287 |
// socket is datagram-oriented and its receive/send buffer size is set
|
williamr@2
|
288 |
// to KSocketBufSizeUndefined, then the initial buffer size will
|
williamr@2
|
289 |
// be KSocketDefaultBufferSize and buffers will grow to accommodate
|
williamr@2
|
290 |
// larger sends/receives. If the buffer size is set explicitly for
|
williamr@2
|
291 |
// datagram-oriented sockets, sends which exceed the set size will fail
|
williamr@2
|
292 |
// with KErrTooBig and receives will be truncated. For stream based
|
williamr@2
|
293 |
// sockets there should be no noticeable effect on client reads, unless the buffer
|
williamr@2
|
294 |
// size is set to a prohibitively low value.
|
williamr@2
|
295 |
/** Debugging enabled or disabled . Values are:
|
williamr@2
|
296 |
|
williamr@2
|
297 |
(TInt)0. Disabled
|
williamr@2
|
298 |
|
williamr@2
|
299 |
(TInt)1. Enabled
|
williamr@2
|
300 |
@publishedAll
|
williamr@2
|
301 |
@released */
|
williamr@2
|
302 |
const TUint KSODebug=1;
|
williamr@2
|
303 |
/** Socket receive buffer size. Values are:
|
williamr@2
|
304 |
|
williamr@2
|
305 |
KSocketBufSizeUndefined
|
williamr@2
|
306 |
|
williamr@2
|
307 |
1 to KMaxTUint: explicit buffer size, supplied as a TPckgBuf<TUint> */
|
williamr@2
|
308 |
const TUint KSORecvBuf=2;
|
williamr@2
|
309 |
/** Socket send buffer size. Values are:
|
williamr@2
|
310 |
|
williamr@2
|
311 |
KSocketBufSizeUndefined
|
williamr@2
|
312 |
|
williamr@2
|
313 |
1 to KMaxTUint: explicit buffer size, supplied as a TPckgBuf<TUint> */
|
williamr@2
|
314 |
const TUint KSOSendBuf=3;
|
williamr@2
|
315 |
/** Socket nonblocking mode. To set, no option values are required. For getting,
|
williamr@2
|
316 |
values are:
|
williamr@2
|
317 |
|
williamr@2
|
318 |
(TInt)0. Disabled
|
williamr@2
|
319 |
|
williamr@2
|
320 |
(TInt)1. Enabled */
|
williamr@2
|
321 |
const TUint KSONonBlockingIO=4;
|
williamr@2
|
322 |
/** Socket blocking mode. To set, no values are required. For getting, values are:
|
williamr@2
|
323 |
|
williamr@2
|
324 |
(TInt)0. Disabled
|
williamr@2
|
325 |
|
williamr@2
|
326 |
(TInt)1. Enabled */
|
williamr@2
|
327 |
const TUint KSOBlockingIO=5;
|
williamr@2
|
328 |
/** Getting only: gets a bitmask of flags describing the read/write/exception status
|
williamr@2
|
329 |
of the socket. Value is a TInt containing a bitmask of socket status (KSockSelectExcept
|
williamr@2
|
330 |
etc.) constants. */
|
williamr@2
|
331 |
const TUint KSOSelectPoll=6;
|
williamr@2
|
332 |
/** Getting only: retrieve the number of bytes currently available for reading.
|
williamr@2
|
333 |
Value is a TInt. */
|
williamr@2
|
334 |
const TUint KSOReadBytesPending=7;
|
williamr@2
|
335 |
/** Getting only: retrieve the urgent data offset (only for stream protocols that
|
williamr@2
|
336 |
support urgent data).
|
williamr@2
|
337 |
Value is a TInt. */
|
williamr@2
|
338 |
const TUint KSOUrgentDataOffset=8;
|
williamr@2
|
339 |
/** Getting only: retrieves the last error. Value is a TInt. */
|
williamr@2
|
340 |
const TUint KSOSelectLastError=9;
|
williamr@2
|
341 |
|
williamr@2
|
342 |
|
williamr@2
|
343 |
/**
|
williamr@2
|
344 |
Setting only. Enables socket to be transferred to the process with given capabilities.
|
williamr@2
|
345 |
The capabilities set should be supplied as TPckgBuf<TSecurityPolicy>.
|
williamr@2
|
346 |
Each RSocket::Transfer() call must be enabled by setting this option.
|
williamr@2
|
347 |
@publishedAll
|
williamr@2
|
348 |
@released */
|
williamr@2
|
349 |
const TUint KSOEnableTransfer = 10;
|
williamr@2
|
350 |
|
williamr@2
|
351 |
/** Setting only. Disables a socket's possibility to be transferred. No option required.
|
williamr@2
|
352 |
@publishedAll
|
williamr@2
|
353 |
@released */
|
williamr@2
|
354 |
|
williamr@2
|
355 |
const TUint KSODisableTransfer = 11;
|
williamr@2
|
356 |
|
williamr@2
|
357 |
// The following constants relating to buffer sizes are defined
|
williamr@2
|
358 |
|
williamr@2
|
359 |
/** Use default buffer size. */
|
williamr@2
|
360 |
const TInt KSocketBufSizeUndefined=0;
|
williamr@2
|
361 |
/** Default buffer size. */
|
williamr@2
|
362 |
const TInt KSocketDefaultBufferSize=4096;
|
williamr@2
|
363 |
|
williamr@2
|
364 |
//internal
|
williamr@2
|
365 |
const TUint KSocketInternalOptionBit=0x80000000; ///< Must not be set for client requests
|
williamr@2
|
366 |
|
williamr@2
|
367 |
/**
|
williamr@2
|
368 |
Ioctls
|
williamr@2
|
369 |
|
williamr@2
|
370 |
Must not be set for client requests
|
williamr@2
|
371 |
|
williamr@2
|
372 |
@internalComponent
|
williamr@2
|
373 |
@released
|
williamr@2
|
374 |
*/
|
williamr@2
|
375 |
const TUint KInternalIoctlBit=0x80000000;
|
williamr@2
|
376 |
|
williamr@2
|
377 |
/** The aDesc parameter of RSocket::Ioctl() specifies a TUint containing a bitmask
|
williamr@2
|
378 |
of Socket status constants. The completion status will be the subset of those
|
williamr@2
|
379 |
conditions which is now true for the socket.
|
williamr@2
|
380 |
|
williamr@2
|
381 |
Used through RSocket::Ioctl(), with aLevel set to KSOLSocket.
|
williamr@2
|
382 |
|
williamr@2
|
383 |
@see KSOSelectPoll parameter to RSocket::GetOpt(), which allows the
|
williamr@2
|
384 |
current select state of the socket to be read synchronously, and KSOSelectLastError,
|
williamr@2
|
385 |
which returns the error code. */
|
williamr@2
|
386 |
const TUint KIOctlSelect=1;
|
williamr@2
|
387 |
|
williamr@2
|
388 |
// Select ioctl states
|
williamr@2
|
389 |
// Socket status. See also KSOSelectLastError and KSOSelectPoll.
|
williamr@2
|
390 |
/** Data is available to be read; for listening sockets, a connect is pending.
|
williamr@2
|
391 |
@publishedAll
|
williamr@2
|
392 |
@released */
|
williamr@2
|
393 |
const TUint KSockSelectRead =0x00000001;
|
williamr@2
|
394 |
/** Writing to the socket is not currently blocked by flow-control. */
|
williamr@2
|
395 |
const TUint KSockSelectWrite =0x00000002;
|
williamr@2
|
396 |
/** An error has occurred. */
|
williamr@2
|
397 |
const TUint KSockSelectExcept =0x00000004;
|
williamr@2
|
398 |
/** Include tail of prior read datagram as available data (ie indicates next read will be with read continuation) */
|
williamr@2
|
399 |
const TUint KSockSelectReadContinuation = 0x01000000;
|
williamr@2
|
400 |
|
williamr@2
|
401 |
// Socket write flags
|
williamr@2
|
402 |
/** The data to be sent is urgent and is given a higher priority than ordinary data in the send queue.
|
williamr@2
|
403 |
KSockWriteUrgent may only be provided as a flag to Send() if the protocol's information flag is marked with
|
williamr@2
|
404 |
KSIUrgentData, otherwise Send() will return with KErrNotSupported. AKA: Out of band or unit data.
|
williamr@2
|
405 |
@publishedAll
|
williamr@2
|
406 |
@released */
|
williamr@2
|
407 |
const TUint KSockWriteUrgent=0x00000001;
|
williamr@2
|
408 |
/** Must not be set for client requests. */
|
williamr@2
|
409 |
const TUint KSocketInternalWriteBit=0x80000000;
|
williamr@2
|
410 |
/** The top 8 bits are reserved for system purposes; protocols must not define these bits. */
|
williamr@2
|
411 |
const TUint KSockWriteSystemMask=0xFF000000;
|
williamr@2
|
412 |
|
williamr@2
|
413 |
// Socket read flags
|
williamr@2
|
414 |
/** Read data without consuming it, data remains in the receive queue. KSockReadPeek may only be provided
|
williamr@2
|
415 |
as a flag to Recv() if the protocol's information flag is marked with KSIPeekData, otherwise Recv() will
|
williamr@2
|
416 |
return with KErrNotSupported.
|
williamr@2
|
417 |
@publishedAll
|
williamr@2
|
418 |
@released
|
williamr@2
|
419 |
*/
|
williamr@2
|
420 |
const TUint KSockReadPeek=0x00000001;
|
williamr@2
|
421 |
/** Must not be set for client requests. */
|
williamr@2
|
422 |
const TUint KSocketInternalReadBit=0x80000000;
|
williamr@2
|
423 |
/** Read from datagram in a stream-like fashion (not discarding tails). */
|
williamr@2
|
424 |
const TUint KSockReadContinuation = 0x01000000;
|
williamr@2
|
425 |
// Types
|
williamr@2
|
426 |
|
williamr@2
|
427 |
/** Used in structure TProtocolDesc to describes the endianness of a protocol.
|
williamr@2
|
428 |
@publishedAll
|
williamr@2
|
429 |
@released */
|
williamr@2
|
430 |
enum TByteOrder
|
williamr@2
|
431 |
{
|
williamr@2
|
432 |
/** Big endian */
|
williamr@2
|
433 |
EBigEndian,
|
williamr@2
|
434 |
/** Little endian */
|
williamr@2
|
435 |
ELittleEndian,
|
williamr@2
|
436 |
/** Other byte order */
|
williamr@2
|
437 |
EOtherByteOrder,
|
williamr@2
|
438 |
};
|
williamr@2
|
439 |
|
williamr@2
|
440 |
//
|
williamr@2
|
441 |
// Protocol Service information bitmasks.
|
williamr@2
|
442 |
// The following constants are defined for
|
williamr@2
|
443 |
// TServerProtocolDesc and TProtocolDesc
|
williamr@2
|
444 |
//
|
williamr@2
|
445 |
/** The protocol is connectionless.
|
williamr@2
|
446 |
@publishedPartner
|
williamr@2
|
447 |
@released */
|
williamr@2
|
448 |
const TUint KSIConnectionLess=0x00000001;
|
williamr@2
|
449 |
/** The protocol is reliable. */
|
williamr@2
|
450 |
const TUint KSIReliable=0x00000002;
|
williamr@2
|
451 |
/** The protocol guarantees in-order delivery. */
|
williamr@2
|
452 |
const TUint KSIInOrder=0x00000004;
|
williamr@2
|
453 |
/** The protocol is message based. */
|
williamr@2
|
454 |
const TUint KSIMessageBased=0x00000008;
|
williamr@2
|
455 |
/** The same as message based. */
|
williamr@2
|
456 |
const TUint KSIDatagram=KSIMessageBased;
|
williamr@2
|
457 |
/** The protocol is stream based. */
|
williamr@2
|
458 |
const TUint KSIStreamBased=0x00000010;
|
williamr@2
|
459 |
/** The protocol supports a stream like interface but maintains datagram boundaries. */
|
williamr@2
|
460 |
const TUint KSIPseudoStream=0x00000020;
|
williamr@2
|
461 |
/** The protocol offers an expedited data service. */
|
williamr@2
|
462 |
const TUint KSIUrgentData=0x00000040;
|
williamr@2
|
463 |
/** The protocol can send user data on a connection request. */
|
williamr@2
|
464 |
const TUint KSIConnectData=0x00000080;
|
williamr@2
|
465 |
/** The protocol can send user data on a disconnect request. */
|
williamr@2
|
466 |
const TUint KSIDisconnectData=0x00000100;
|
williamr@2
|
467 |
/** The protocol supports broadcast addresses. */
|
williamr@2
|
468 |
const TUint KSIBroadcast=0x00000200;
|
williamr@2
|
469 |
/** The protocol supports point to multi-point connections. */
|
williamr@2
|
470 |
const TUint KSIMultiPoint=0x00000400;
|
williamr@2
|
471 |
/** The protocol supports a quality of service metric. */
|
williamr@2
|
472 |
const TUint KSIQOS=0x00000800;
|
williamr@2
|
473 |
/** The protocol is write only. */
|
williamr@2
|
474 |
const TUint KSIWriteOnly=0x00001000;
|
williamr@2
|
475 |
/** The protocol is read only. */
|
williamr@2
|
476 |
const TUint KSIReadOnly=0x00002000;
|
williamr@2
|
477 |
/** The protocol supports graceful close. */
|
williamr@2
|
478 |
const TUint KSIGracefulClose=0x00004000;
|
williamr@2
|
479 |
/** The same socket can be reconnected if it disconnects (for whatever reason). */
|
williamr@2
|
480 |
const TUint KSICanReconnect=0x00008000;
|
williamr@2
|
481 |
/** Protocol supports peeking (looking at the data without removing it from the
|
williamr@2
|
482 |
protocol). */
|
williamr@2
|
483 |
const TUint KSIPeekData=0x00010000;
|
williamr@2
|
484 |
/** Protocol is to be informed of the identity of the client (i.e. process ID,
|
williamr@2
|
485 |
thread ID and UID) of each SAP (i.e. Socket Service Provider) created.
|
williamr@2
|
486 |
@see KSoOwnerInfo and TSoOwnerInfo */
|
williamr@2
|
487 |
const TUint KSIRequiresOwnerInfo=0x00020000; // SetOption(KSoOwnerInfo) invoked on each SAP
|
williamr@2
|
488 |
|
williamr@2
|
489 |
//
|
williamr@2
|
490 |
// Naming service constants
|
williamr@2
|
491 |
// The following constants are defined for
|
williamr@2
|
492 |
// TServerProtocolDesc and TProtocolDesc
|
williamr@2
|
493 |
//
|
williamr@2
|
494 |
/** Protocol supports resolving human readable entity names into network addresses
|
williamr@2
|
495 |
(like DNS).
|
williamr@2
|
496 |
@publishedPartner
|
williamr@2
|
497 |
@released */
|
williamr@2
|
498 |
const TUint KNSNameResolution=0x00000001;
|
williamr@2
|
499 |
/** Network naming is hierarchical. */
|
williamr@2
|
500 |
const TUint KNSHierarchicalNaming=0x00000002;
|
williamr@2
|
501 |
/** @deprecated Use KNSHierarchicalNaming instead. */
|
williamr@2
|
502 |
const TUint KNSHeirarchicalNaming=0x00000002;
|
williamr@2
|
503 |
/** Addressing is dynamic and should be attempted every time before connecting
|
williamr@2
|
504 |
(like IrDA). */
|
williamr@2
|
505 |
const TUint KNSRemoteDiscovery=0x00000004;
|
williamr@2
|
506 |
/** Protocol supports service name to port number resolution. (For example, you
|
williamr@2
|
507 |
can look up TCP to get port 48.) */
|
williamr@2
|
508 |
const TUint KNSServiceResolution=0x00000008;
|
williamr@2
|
509 |
/** Protocol supports additions to the name database. */
|
williamr@2
|
510 |
const TUint KNSNameRegistration=0x00000010;
|
williamr@2
|
511 |
/** Protocol supports additions to the service database. */
|
williamr@2
|
512 |
const TUint KNSServiceRegistration=0x00000020;
|
williamr@2
|
513 |
/** Addressing is dynamic - i.e. name to address mapping may change (like IrDA
|
williamr@2
|
514 |
which randomly chooses machine addresses.) */
|
williamr@2
|
515 |
const TUint KNSDynamicAddressing=0x00000040;
|
williamr@2
|
516 |
/** Protocol has another database which is defined by the protocol. */
|
williamr@2
|
517 |
const TUint KNSInfoDatabase=0x00000080;
|
williamr@2
|
518 |
/** Protocol may request Socket Server to startup a connection on its behalf (via
|
williamr@2
|
519 |
the KErrCompletion error code)*/
|
williamr@2
|
520 |
const TUint KNSRequiresConnectionStartup=0x00000100;
|
williamr@2
|
521 |
|
williamr@2
|
522 |
// Security Schemes
|
williamr@2
|
523 |
// The following constants are defined for
|
williamr@2
|
524 |
// TServerProtocolDesc and TProtocolDesc
|
williamr@2
|
525 |
/** No security
|
williamr@2
|
526 |
@publishedAll
|
williamr@2
|
527 |
@released */
|
williamr@2
|
528 |
const TUint KSocketNoSecurity=0x00000000;
|
williamr@2
|
529 |
/** Secure Sockets Layer.
|
williamr@2
|
530 |
|
williamr@2
|
531 |
@see CSecureSocket */
|
williamr@2
|
532 |
const TUint KSecureSockets=0x00000001;
|
williamr@2
|
533 |
|
williamr@2
|
534 |
// Special message sizes
|
williamr@2
|
535 |
// The following constants are defined for
|
williamr@2
|
536 |
// TServerProtocolDesc and TProtocolDesc
|
williamr@2
|
537 |
/** Reads and writes can be of any size: the data is treated as a stream.
|
williamr@2
|
538 |
@publishedAll
|
williamr@2
|
539 |
@released */
|
williamr@2
|
540 |
const TInt KSocketMessageSizeIsStream=0;
|
williamr@2
|
541 |
/** Depends on lower layer or is dynamic. */
|
williamr@2
|
542 |
const TInt KSocketMessageSizeUndefined=1;
|
williamr@2
|
543 |
/** Data is packet-oriented but packets can be of any size (i.e. the remote end
|
williamr@2
|
544 |
must specify a Read of the same size as your Write, but there is no limit
|
williamr@2
|
545 |
on this size.) */
|
williamr@2
|
546 |
const TInt KSocketMessageSizeNoLimit=-1;
|
williamr@2
|
547 |
|
williamr@2
|
548 |
|
williamr@2
|
549 |
/** Undefined socket type.
|
williamr@2
|
550 |
@publishedAll
|
williamr@2
|
551 |
@released */
|
williamr@2
|
552 |
const TUint KUndefinedSockType=0xFFFFFFFF;
|
williamr@2
|
553 |
|
williamr@2
|
554 |
|
williamr@2
|
555 |
/** Undefined socket type.
|
williamr@2
|
556 |
Undefined Protocol
|
williamr@2
|
557 |
@released */
|
williamr@2
|
558 |
const TUint KUndefinedProtocol=0xFFFFFFFE;
|
williamr@2
|
559 |
|
williamr@2
|
560 |
/** Contains the name of a protocol in structure TProtocolDesc.
|
williamr@2
|
561 |
@publishedAll
|
williamr@2
|
562 |
@released */
|
williamr@2
|
563 |
typedef TBuf<0x20> TProtocolName;
|
williamr@2
|
564 |
/** Defines a descriptor to hold a service name string. */
|
williamr@2
|
565 |
typedef TBuf<0x20> TServiceName;
|
williamr@2
|
566 |
/** Defines a descriptor to hold a host name string. */
|
williamr@2
|
567 |
typedef TBuf<0x100> THostName;
|
williamr@2
|
568 |
|
williamr@2
|
569 |
/**
|
williamr@2
|
570 |
Socket protocol information for use by clients
|
williamr@2
|
571 |
|
williamr@2
|
572 |
@publishedAll
|
williamr@2
|
573 |
@released
|
williamr@2
|
574 |
*/
|
williamr@2
|
575 |
struct TProtocolDesc
|
williamr@2
|
576 |
/** Socket protocol information for use by clients. */
|
williamr@2
|
577 |
{
|
williamr@2
|
578 |
public:
|
williamr@2
|
579 |
/** The name of the protocol
|
williamr@2
|
580 |
|
williamr@2
|
581 |
@see TProtocolName */
|
williamr@2
|
582 |
TProtocolName iName;
|
williamr@2
|
583 |
/** An integer identifying the protocol's address family. For example, for TCP/IP
|
williamr@2
|
584 |
protocols, KAfInet. */
|
williamr@2
|
585 |
TUint iAddrFamily;
|
williamr@2
|
586 |
/** An integer specifying the socket type. For example, for TCP, KSockStream. */
|
williamr@2
|
587 |
TUint iSockType;
|
williamr@2
|
588 |
/** An integer specifying the specific protocol. For example, for TCP, KProtocolInetTcp. */
|
williamr@2
|
589 |
TUint iProtocol;
|
williamr@2
|
590 |
/** The version of the protocol
|
williamr@2
|
591 |
|
williamr@2
|
592 |
@see TVersion */
|
williamr@2
|
593 |
TVersion iVersion;
|
williamr@2
|
594 |
/** The byte order that the protocol uses
|
williamr@2
|
595 |
|
williamr@2
|
596 |
@see TByteOrder */
|
williamr@2
|
597 |
TByteOrder iByteOrder;
|
williamr@2
|
598 |
/** A bit mask of service information flags.
|
williamr@2
|
599 |
|
williamr@2
|
600 |
@see KSockStream etc. */
|
williamr@2
|
601 |
TUint iServiceInfo;
|
williamr@2
|
602 |
/** A bit mask indicating if the protocol supports name resolution, service resolution,
|
williamr@2
|
603 |
or database access services.
|
williamr@2
|
604 |
|
williamr@2
|
605 |
@see KNSNameResolution etc. */
|
williamr@2
|
606 |
TUint iNamingServices;
|
williamr@2
|
607 |
/** A bitmask of security flags.
|
williamr@2
|
608 |
|
williamr@2
|
609 |
@see KSocketNoSecurity etc. */
|
williamr@2
|
610 |
TUint iSecurity;
|
williamr@2
|
611 |
/** The message size of datagram protocols.
|
williamr@2
|
612 |
|
williamr@2
|
613 |
@see KSocketMessageSizeIsStream etc. */
|
williamr@2
|
614 |
TInt iMessageSize;
|
williamr@2
|
615 |
};
|
williamr@2
|
616 |
|
williamr@2
|
617 |
// socket errors
|
williamr@2
|
618 |
/** This error is returned from operations on non-blocking sockets that cannot
|
williamr@2
|
619 |
be completed immediately, for example receive when no data is queued for reading.
|
williamr@2
|
620 |
It is a non-fatal error, and the operation should be retried later.
|
williamr@2
|
621 |
@publishedAll
|
williamr@2
|
622 |
@released */
|
williamr@2
|
623 |
const TInt KErrWouldBlock=-1000;
|
williamr@2
|
624 |
|
williamr@2
|
625 |
/**
|
williamr@2
|
626 |
socket errors
|
williamr@2
|
627 |
|
williamr@2
|
628 |
The value -17210 is taken from the range allocated for Esock (beginning at -17200)
|
williamr@2
|
629 |
A gap has been left between the currently existing vals and this one.
|
williamr@2
|
630 |
|
williamr@2
|
631 |
@publishedAll
|
williamr@2
|
632 |
@released
|
williamr@2
|
633 |
*/
|
williamr@2
|
634 |
const TInt KErrConnectionTerminated=-17210;
|
williamr@2
|
635 |
|
williamr@2
|
636 |
const TInt KErrCannotFindProtocol = -17211;
|
williamr@2
|
637 |
|
williamr@2
|
638 |
/** Used in RSocket read and write calls to pass the length of data read and written.
|
williamr@2
|
639 |
@publishedAll
|
williamr@2
|
640 |
@released */
|
williamr@2
|
641 |
typedef TPckgBuf<TInt> TSockXfrLength;
|
williamr@2
|
642 |
|
williamr@2
|
643 |
class TSockIO
|
williamr@2
|
644 |
/**
|
williamr@2
|
645 |
IPC Data holder
|
williamr@2
|
646 |
|
williamr@2
|
647 |
@internalComponent
|
williamr@2
|
648 |
*/
|
williamr@2
|
649 |
{
|
williamr@2
|
650 |
public:
|
williamr@2
|
651 |
const TSockXfrLength* iLength; ///< length of data read and written
|
williamr@2
|
652 |
TUint iFlags; ///< Flag
|
williamr@2
|
653 |
TSockAddr* iAddr; ///< Socket Address
|
williamr@2
|
654 |
};
|
williamr@2
|
655 |
|
williamr@2
|
656 |
class TSockIOBufC : public TPckgC<TSockIO>
|
williamr@2
|
657 |
/** @internalComponent */
|
williamr@2
|
658 |
{
|
williamr@2
|
659 |
public:
|
williamr@2
|
660 |
inline TSockIOBufC();
|
williamr@2
|
661 |
TSockIO iArgs;
|
williamr@2
|
662 |
};
|
williamr@2
|
663 |
|
williamr@2
|
664 |
class TSockOpen
|
williamr@2
|
665 |
/** @internalComponent */
|
williamr@2
|
666 |
{
|
williamr@2
|
667 |
public:
|
williamr@2
|
668 |
TUint iAddrFamily;
|
williamr@2
|
669 |
TUint iSockType;
|
williamr@2
|
670 |
TUint iProtocol;
|
williamr@2
|
671 |
TInt iHandle;
|
williamr@2
|
672 |
TInt iReserved;
|
williamr@2
|
673 |
};
|
williamr@2
|
674 |
|
williamr@2
|
675 |
class TSockOpenBufC : public TPckgC<TSockOpen>
|
williamr@2
|
676 |
/** @internalComponent */
|
williamr@2
|
677 |
{
|
williamr@2
|
678 |
public:
|
williamr@2
|
679 |
inline TSockOpenBufC();
|
williamr@2
|
680 |
TSockOpen iArgs;
|
williamr@2
|
681 |
};
|
williamr@2
|
682 |
|
williamr@2
|
683 |
class RSocket;
|
williamr@2
|
684 |
class RConnection;
|
williamr@2
|
685 |
class RSocketServ : public RSessionBase
|
williamr@2
|
686 |
/** Provides the Connect() function to create an IPC communication channel to the
|
williamr@2
|
687 |
socket server. To close the channel RHandleBase provides a RHandleBase::Close()
|
williamr@2
|
688 |
function.
|
williamr@2
|
689 |
|
williamr@2
|
690 |
The prime use for instances of RSocketServ is to establish subsession communications
|
williamr@2
|
691 |
for RSocket, RHostResolver, RNetDatabase and RConnection. Any of the resources
|
williamr@2
|
692 |
which are open using the session are automatically closed when the session is
|
williamr@2
|
693 |
terminated, however it is more appropriate to issue a Close() on each subsession object
|
williamr@2
|
694 |
before closing the session.
|
williamr@2
|
695 |
|
williamr@2
|
696 |
The following operations are also provided:
|
williamr@2
|
697 |
|
williamr@2
|
698 |
NumProtocols() - enumerates the number of protocols of which the socket server
|
williamr@2
|
699 |
is currently aware.
|
williamr@2
|
700 |
|
williamr@2
|
701 |
GetProtocolInfo()/FindProtocol() - return information about a specific protocol.
|
williamr@2
|
702 |
|
williamr@2
|
703 |
StartProtocol() - loads a protocol asynchronously.
|
williamr@2
|
704 |
|
williamr@2
|
705 |
@note This class is not intended for user derivation.
|
williamr@2
|
706 |
@publishedAll
|
williamr@2
|
707 |
@released */
|
williamr@2
|
708 |
{
|
williamr@2
|
709 |
public:
|
williamr@2
|
710 |
IMPORT_C RSocketServ();
|
williamr@2
|
711 |
IMPORT_C TInt Connect(TUint aMessageSlots=KESockDefaultMessageSlots);
|
williamr@2
|
712 |
IMPORT_C TInt Connect(const TSessionPref& aPref, TUint aMessageSlots=KESockDefaultMessageSlots);
|
williamr@2
|
713 |
IMPORT_C TVersion Version() const;
|
williamr@2
|
714 |
IMPORT_C TInt NumProtocols(TUint& aCount);
|
williamr@2
|
715 |
IMPORT_C TInt GetProtocolInfo(TUint anIndex,TProtocolDesc& aProtocol);
|
williamr@2
|
716 |
IMPORT_C TInt FindProtocol(const TProtocolName& aName,TProtocolDesc& aProtocol);
|
williamr@2
|
717 |
IMPORT_C void StartProtocol(TUint anAddrFamily,TUint aSockType,TUint aProtocol,TRequestStatus& aStatus);
|
williamr@2
|
718 |
IMPORT_C void StopProtocol(TUint anAddrFamily,TUint aSockType,TUint aProtocol,TRequestStatus& aStatus);
|
williamr@2
|
719 |
IMPORT_C TInt InstallExtension(const TDesC& aDllName, const TDesC& aArgs=TPtrC());
|
williamr@2
|
720 |
IMPORT_C void SetExclusiveMode(TRequestStatus& aStatus);
|
williamr@2
|
721 |
IMPORT_C void ClearExclusiveMode();
|
williamr@2
|
722 |
IMPORT_C TInt __DbgMarkHeap();
|
williamr@2
|
723 |
IMPORT_C TInt __DbgCheckHeap(TInt aCount);
|
williamr@2
|
724 |
IMPORT_C TInt __DbgMarkEnd(TInt aCount);
|
williamr@2
|
725 |
IMPORT_C TInt __DbgFailNext(TInt aCount);
|
williamr@2
|
726 |
IMPORT_C TBool __DbgCheckFailNext() const;
|
williamr@2
|
727 |
IMPORT_C TInt __DbgFailNextMbuf(TInt aCount);
|
williamr@2
|
728 |
IMPORT_C TInt __DbgSetMbufPoolLimit(TInt asize);
|
williamr@2
|
729 |
IMPORT_C TInt __DbgCheckMbuf(TInt asize);
|
williamr@2
|
730 |
IMPORT_C TInt __DbgMbufFreeSpace();
|
williamr@2
|
731 |
IMPORT_C TInt __DbgMbufTotalSpace();
|
williamr@2
|
732 |
};
|
williamr@2
|
733 |
|
williamr@2
|
734 |
NONSHARABLE_CLASS(RCommsSubSession) : public RSubSessionBase
|
williamr@2
|
735 |
{
|
williamr@2
|
736 |
friend class RCommsApiExtensionBase;
|
williamr@2
|
737 |
};
|
williamr@2
|
738 |
|
williamr@2
|
739 |
class RSubConnection;
|
williamr@2
|
740 |
class RSocket : public RCommsSubSession
|
williamr@2
|
741 |
/** Provides a client endpoint to a protocol. It provides functions for socket
|
williamr@2
|
742 |
creation, reading, writing, passive connection, active connection, setting
|
williamr@2
|
743 |
addresses and querying addresses. Use this class as an endpoint for network
|
williamr@2
|
744 |
type communications. It provides the following services:
|
williamr@2
|
745 |
|
williamr@2
|
746 |
reading from and writing to protocol
|
williamr@2
|
747 |
|
williamr@2
|
748 |
binding to addresses
|
williamr@2
|
749 |
|
williamr@2
|
750 |
active connecting
|
williamr@2
|
751 |
|
williamr@2
|
752 |
passive connection through the listen/accept model
|
williamr@2
|
753 |
|
williamr@2
|
754 |
Before using any of these services, a connection to a socket server session
|
williamr@2
|
755 |
must have been made and the socket must be open.
|
williamr@2
|
756 |
|
williamr@2
|
757 |
@publishedAll
|
williamr@2
|
758 |
@released Since v5.0*/
|
williamr@2
|
759 |
{
|
williamr@2
|
760 |
friend class RSocketServ;
|
williamr@2
|
761 |
public:
|
williamr@2
|
762 |
/** Used in structure TProtocolDesc to describes the endianness of a protocol. */
|
williamr@2
|
763 |
enum TShutdown
|
williamr@2
|
764 |
{
|
williamr@2
|
765 |
/** Complete when socket output/input stopped. */
|
williamr@2
|
766 |
ENormal,
|
williamr@2
|
767 |
/** Stop socket input and complete when output is stopped. */
|
williamr@2
|
768 |
EStopInput,
|
williamr@2
|
769 |
/** Stop socket output and complete when input is stopped. */
|
williamr@2
|
770 |
EStopOutput,
|
williamr@2
|
771 |
/** Stop socket input/output and complete (abortive close). */
|
williamr@2
|
772 |
EImmediate
|
williamr@2
|
773 |
};
|
williamr@2
|
774 |
public:
|
williamr@2
|
775 |
IMPORT_C RSocket();
|
williamr@2
|
776 |
|
williamr@2
|
777 |
IMPORT_C TInt Open(RSocketServ& aServer,TUint addrFamily,TUint sockType,TUint protocol);
|
williamr@2
|
778 |
IMPORT_C TInt Open(RSocketServ& aServer,TUint addrFamily,TUint sockType,TUint protocol, RConnection& aConnection);
|
williamr@2
|
779 |
IMPORT_C TInt Open(RSocketServ& aServer,TUint addrFamily,TUint sockType,TUint protocol, RSubConnection& aSubConnection);
|
williamr@2
|
780 |
IMPORT_C TInt Open(RSocketServ &aServer,const TDesC& aName);
|
williamr@2
|
781 |
IMPORT_C TInt Open(RSocketServ& aServer);
|
williamr@2
|
782 |
IMPORT_C void Send(const TDesC8& aDesc,TUint someFlags,TRequestStatus& aStatus);
|
williamr@2
|
783 |
|
williamr@2
|
784 |
IMPORT_C void Send(const TDesC8& aDesc,TUint someFlags,TRequestStatus& aStatus,TSockXfrLength& aLen);
|
williamr@2
|
785 |
IMPORT_C void CancelSend();
|
williamr@2
|
786 |
|
williamr@2
|
787 |
IMPORT_C void Recv(TDes8& aDesc,TUint flags,TRequestStatus& aStatus);
|
williamr@2
|
788 |
|
williamr@2
|
789 |
IMPORT_C void Recv(TDes8& aDesc,TUint flags,TRequestStatus& aStatus,TSockXfrLength& aLen);
|
williamr@2
|
790 |
|
williamr@2
|
791 |
IMPORT_C void RecvOneOrMore(TDes8& aDesc,TUint flags,TRequestStatus& aStatus,TSockXfrLength& aLen);
|
williamr@2
|
792 |
IMPORT_C void CancelRecv();
|
williamr@2
|
793 |
|
williamr@2
|
794 |
IMPORT_C void Read(TDes8& aDesc,TRequestStatus& aStatus);
|
williamr@2
|
795 |
IMPORT_C void CancelRead();
|
williamr@2
|
796 |
|
williamr@2
|
797 |
IMPORT_C void Write(const TDesC8& aDesc,TRequestStatus& aStatus);
|
williamr@2
|
798 |
IMPORT_C void CancelWrite();
|
williamr@2
|
799 |
IMPORT_C void SendTo(const TDesC8& aDesc,TSockAddr& anAddr,TUint flags,TRequestStatus& aStatus);
|
williamr@2
|
800 |
|
williamr@2
|
801 |
IMPORT_C void SendTo(const TDesC8& aDesc,TSockAddr& anAddr,TUint flags,TRequestStatus& aStatus,TSockXfrLength& aLen);
|
williamr@2
|
802 |
|
williamr@2
|
803 |
IMPORT_C void RecvFrom(TDes8& aDesc,TSockAddr& anAddr,TUint flags,TRequestStatus& aStatus);
|
williamr@2
|
804 |
|
williamr@2
|
805 |
IMPORT_C void RecvFrom(TDes8& aDesc,TSockAddr& anAddr,TUint flags,TRequestStatus& aStatus,TSockXfrLength& aLen);
|
williamr@2
|
806 |
IMPORT_C void Connect(TSockAddr& anAddr,TRequestStatus& aStatus);
|
williamr@2
|
807 |
IMPORT_C void Connect(TSockAddr& anAddr,const TDesC8& aConnectDataOut,TDes8& aConnectDataIn,TRequestStatus& aStatus);
|
williamr@2
|
808 |
IMPORT_C void CancelConnect();
|
williamr@2
|
809 |
IMPORT_C TInt Bind(TSockAddr& anAddr);
|
williamr@2
|
810 |
IMPORT_C TInt SetLocalPort(TInt aPort);
|
williamr@2
|
811 |
IMPORT_C void Accept(RSocket& aBlankSocket,TRequestStatus& aStatus);
|
williamr@2
|
812 |
IMPORT_C void Accept(RSocket& aBlankSocket,TDes8& aConnectData,TRequestStatus& aStatus);
|
williamr@2
|
813 |
IMPORT_C void CancelAccept();
|
williamr@2
|
814 |
IMPORT_C TInt Listen(TUint qSize);
|
williamr@2
|
815 |
IMPORT_C TInt Listen(TUint qSize,const TDesC8& aConnectData);
|
williamr@2
|
816 |
IMPORT_C TInt SetOpt(TUint anOptionName,TUint anOptionLevel,const TDesC8& anOption=TPtrC8(NULL,0));
|
williamr@2
|
817 |
IMPORT_C TInt SetOpt(TUint anOptionName,TUint anOptionLevel,TInt anOption);
|
williamr@2
|
818 |
IMPORT_C TInt GetOpt(TUint anOptionName,TUint anOptionLevel,TDes8& anOption);
|
williamr@2
|
819 |
IMPORT_C TInt GetOpt(TUint anOptionName,TUint anOptionLevel,TInt& anOption);
|
williamr@2
|
820 |
IMPORT_C void Ioctl(TUint aCommand,TRequestStatus& aStatus,TDes8* aDesc=NULL,TUint aLevel=KLevelUnspecified);
|
williamr@2
|
821 |
IMPORT_C void CancelIoctl();
|
williamr@2
|
822 |
IMPORT_C TInt GetDisconnectData(TDes8& aDesc);
|
williamr@2
|
823 |
IMPORT_C void LocalName(TSockAddr& anAddr);
|
williamr@2
|
824 |
IMPORT_C TUint LocalPort();
|
williamr@2
|
825 |
IMPORT_C void RemoteName(TSockAddr& anAddr);
|
williamr@2
|
826 |
IMPORT_C void Close();
|
williamr@2
|
827 |
IMPORT_C void Shutdown(TShutdown aHow,TRequestStatus& aStatus);
|
williamr@2
|
828 |
IMPORT_C void Shutdown(TShutdown aHow,const TDesC8& aDisconnectDataOut,TDes8& aDisconnectDataIn,TRequestStatus& aStatus);
|
williamr@2
|
829 |
IMPORT_C void CancelAll();
|
williamr@2
|
830 |
IMPORT_C TInt Info(TProtocolDesc& aProtocol);
|
williamr@2
|
831 |
IMPORT_C TInt Name(TName& aName);
|
williamr@2
|
832 |
IMPORT_C TInt Transfer(RSocketServ& aServer, const TDesC& aName);
|
williamr@2
|
833 |
};
|
williamr@2
|
834 |
|
williamr@2
|
835 |
class TNameRecord
|
williamr@2
|
836 |
/** Contains the results of name queries.
|
williamr@2
|
837 |
@publishedAll
|
williamr@2
|
838 |
@released */
|
williamr@2
|
839 |
{
|
williamr@2
|
840 |
public:
|
williamr@2
|
841 |
inline TNameRecord();
|
williamr@2
|
842 |
/**
|
williamr@2
|
843 |
@internalComponent
|
williamr@2
|
844 |
*/
|
williamr@2
|
845 |
enum {EAlias=0x00000001,};
|
williamr@2
|
846 |
/** A host name
|
williamr@2
|
847 |
|
williamr@2
|
848 |
@see THostName */
|
williamr@2
|
849 |
THostName iName;
|
williamr@2
|
850 |
/** An address
|
williamr@2
|
851 |
|
williamr@2
|
852 |
@see TSockAddr */
|
williamr@2
|
853 |
TSockAddr iAddr;
|
williamr@2
|
854 |
/** Flags indicating some attribute about the name, i.e. EAlias */
|
williamr@2
|
855 |
TInt iFlags;
|
williamr@2
|
856 |
};
|
williamr@2
|
857 |
|
williamr@2
|
858 |
/** Packages the TNameRecord class so that it can be passed between a client and
|
williamr@2
|
859 |
the socket server.
|
williamr@2
|
860 |
@publishedAll
|
williamr@2
|
861 |
@released */
|
williamr@2
|
862 |
typedef TPckgBuf<TNameRecord> TNameEntry;
|
williamr@2
|
863 |
|
williamr@2
|
864 |
class RHostResolver : public RSubSessionBase
|
williamr@2
|
865 |
/** Provides an interface to host name resolution services, such as DNS, that may
|
williamr@2
|
866 |
be provided by particular protocol modules.
|
williamr@2
|
867 |
|
williamr@2
|
868 |
The interface provides functions to access the following facilities:
|
williamr@2
|
869 |
|
williamr@2
|
870 |
Obtaining names from addresses.
|
williamr@2
|
871 |
|
williamr@2
|
872 |
Obtaining addresses from names.
|
williamr@2
|
873 |
|
williamr@2
|
874 |
Getting and setting local host name.
|
williamr@2
|
875 |
|
williamr@2
|
876 |
Not all actual services provide all these facilities. You should also consult
|
williamr@2
|
877 |
the documentation on the protocol you are intending to use. Functions return
|
williamr@2
|
878 |
KErrNotSupported if the protocol does not support a given operation. Note
|
williamr@2
|
879 |
that a description of the protocol family name resolution capabilities is
|
williamr@2
|
880 |
available at run-time from TProtocolDesc::iNamingServices.
|
williamr@2
|
881 |
|
williamr@2
|
882 |
Before using any service, a connection to a socket server session must be
|
williamr@2
|
883 |
made.
|
williamr@2
|
884 |
|
williamr@2
|
885 |
Each function is available in both synchronous and asynchronous versions.
|
williamr@2
|
886 |
|
williamr@2
|
887 |
A single RHostResolver can only perform one request of any type at once. A
|
williamr@2
|
888 |
client is panicked if it makes two requests.
|
williamr@2
|
889 |
@publishedAll
|
williamr@2
|
890 |
@released */
|
williamr@2
|
891 |
{
|
williamr@2
|
892 |
public:
|
williamr@2
|
893 |
IMPORT_C TInt Open(RSocketServ& aSocketServer,TUint anAddrFamily,TUint aProtocol);
|
williamr@2
|
894 |
IMPORT_C TInt Open(RSocketServ& aSocketServer,TUint anAddrFamily,TUint aProtocol, RConnection& aConnection);
|
williamr@2
|
895 |
IMPORT_C void GetByName(const TDesC& aName,TNameEntry& aResult,TRequestStatus& aStatus);
|
williamr@2
|
896 |
IMPORT_C TInt GetByName(const TDesC& aName,TNameEntry& aResult);
|
williamr@2
|
897 |
IMPORT_C void Next(TNameEntry& aResult,TRequestStatus& aStatus);
|
williamr@2
|
898 |
IMPORT_C TInt Next(TNameEntry& aResult);
|
williamr@2
|
899 |
IMPORT_C void GetByAddress(const TSockAddr& anAddr,TNameEntry& aResult,TRequestStatus& aStatus);
|
williamr@2
|
900 |
IMPORT_C TInt GetByAddress(const TSockAddr& anAddr,TNameEntry& aResult);
|
williamr@2
|
901 |
IMPORT_C TInt GetHostName(TDes& aName);
|
williamr@2
|
902 |
IMPORT_C void GetHostName(TDes& aName,TRequestStatus& aStatus);
|
williamr@2
|
903 |
IMPORT_C TInt SetHostName(const TDesC& aName);
|
williamr@2
|
904 |
IMPORT_C void Close();
|
williamr@2
|
905 |
IMPORT_C void Cancel();
|
williamr@2
|
906 |
|
williamr@2
|
907 |
IMPORT_C void Query(const TDesC8& aQuery, TDes8& aResult, TRequestStatus& aStatus);
|
williamr@2
|
908 |
IMPORT_C TInt Query(const TDesC8& aQuery, TDes8& aResult);
|
williamr@2
|
909 |
IMPORT_C void QueryGetNext(TDes8& aResult, TRequestStatus& aStatus);
|
williamr@2
|
910 |
IMPORT_C TInt QueryGetNext(TDes8& aResult);
|
williamr@2
|
911 |
|
williamr@2
|
912 |
private:
|
williamr@2
|
913 |
};
|
williamr@2
|
914 |
|
williamr@2
|
915 |
/**
|
williamr@2
|
916 |
Port number on service
|
williamr@2
|
917 |
|
williamr@2
|
918 |
@publishedAll
|
williamr@2
|
919 |
@released
|
williamr@2
|
920 |
*/
|
williamr@2
|
921 |
typedef TPckgBuf<TInt> TPortNum;
|
williamr@2
|
922 |
|
williamr@2
|
923 |
class RServiceResolver : public RSubSessionBase
|
williamr@2
|
924 |
/** Provides an interface to resolver service names and ports.
|
williamr@2
|
925 |
@publishedAll
|
williamr@2
|
926 |
@released */
|
williamr@2
|
927 |
{
|
williamr@2
|
928 |
public:
|
williamr@2
|
929 |
IMPORT_C TInt Open(RSocketServ& aSocketServer,TUint anAddrFamily,TUint sockType,TUint aProtocol);
|
williamr@2
|
930 |
IMPORT_C void GetByName(const TDesC& aName,TPortNum& aPort,TRequestStatus& aStatus);
|
williamr@2
|
931 |
IMPORT_C TInt GetByName(const TDesC& aName,TPortNum& aPort);
|
williamr@2
|
932 |
IMPORT_C void GetByNumber(const TUint aPort,TDes& aName,TRequestStatus& aStatus);
|
williamr@2
|
933 |
IMPORT_C TInt GetByNumber(const TUint aPort,TDes& aName);
|
williamr@2
|
934 |
IMPORT_C void RegisterService(const TDesC& aName,const TUint& aPort,TRequestStatus& aStatus);
|
williamr@2
|
935 |
IMPORT_C TInt RegisterService(const TDesC& aName,const TUint& aPort);
|
williamr@2
|
936 |
IMPORT_C void RemoveService(const TDesC& aName,const TUint& aPort,TRequestStatus& aStatus);
|
williamr@2
|
937 |
IMPORT_C TInt RemoveService(const TDesC& aName,const TUint& aPort);
|
williamr@2
|
938 |
IMPORT_C void Close();
|
williamr@2
|
939 |
IMPORT_C void Cancel();
|
williamr@2
|
940 |
private:
|
williamr@2
|
941 |
};
|
williamr@2
|
942 |
|
williamr@2
|
943 |
class RNetDatabase: public RSubSessionBase
|
williamr@2
|
944 |
/** Provides an interface to network databases, such as LM-IAS with IrDA, that
|
williamr@2
|
945 |
may be provided by particular protocol modules.
|
williamr@2
|
946 |
|
williamr@2
|
947 |
Before making any queries, a connection to a socket server session must be
|
williamr@2
|
948 |
made.
|
williamr@2
|
949 |
|
williamr@2
|
950 |
Each function is available in both synchronous and asynchronous versions.
|
williamr@2
|
951 |
|
williamr@2
|
952 |
A single RNetDatabase can only perform one request of any type at once. A
|
williamr@2
|
953 |
client is panicked if it makes two requests.
|
williamr@2
|
954 |
|
williamr@2
|
955 |
Particular database access services will specify the format of queries and
|
williamr@2
|
956 |
of responses.
|
williamr@2
|
957 |
@publishedAll
|
williamr@2
|
958 |
@released */
|
williamr@2
|
959 |
{
|
williamr@2
|
960 |
public:
|
williamr@2
|
961 |
IMPORT_C TInt Open(RSocketServ& aSocketServer,TUint anAddrFamily,TUint aProtocol);
|
williamr@2
|
962 |
IMPORT_C void Query(const TDesC8& aQuery,TDes8& aResult,TRequestStatus& aStat);
|
williamr@2
|
963 |
IMPORT_C TInt Query(const TDesC8& aQuery,TDes8& aResult);
|
williamr@2
|
964 |
IMPORT_C void Add(const TDesC8& anItem,TRequestStatus& aStat);
|
williamr@2
|
965 |
IMPORT_C TInt Add(const TDesC8& anItem);
|
williamr@2
|
966 |
IMPORT_C void Remove(const TDesC8& anItem,TRequestStatus& aStat);
|
williamr@2
|
967 |
IMPORT_C TInt Remove(const TDesC8& anItem);
|
williamr@2
|
968 |
IMPORT_C void Close();
|
williamr@2
|
969 |
IMPORT_C void Cancel();
|
williamr@2
|
970 |
private:
|
williamr@2
|
971 |
};
|
williamr@2
|
972 |
|
williamr@2
|
973 |
/**
|
williamr@2
|
974 |
@publishedPartner
|
williamr@2
|
975 |
@released
|
williamr@2
|
976 |
*/
|
williamr@2
|
977 |
|
williamr@2
|
978 |
const TUint KCOLConnection = 1; // level for RConnection::Control()
|
williamr@2
|
979 |
const TUint KCOLProvider = 2; // level for RConnection::Control()
|
williamr@2
|
980 |
const TUint KConnInternalOptionBit = 0x80000000; // Must not be set for client requests
|
williamr@2
|
981 |
const TUint KConnWriteUserDataBit = 0x40000000;
|
williamr@2
|
982 |
const TUint KConnReadUserDataBit = 0x20000000;
|
williamr@2
|
983 |
|
williamr@2
|
984 |
/**
|
williamr@2
|
985 |
Level for RConnection::Control()
|
williamr@2
|
986 |
|
williamr@2
|
987 |
@publishedPartner
|
williamr@2
|
988 |
@deprecated in 8.1
|
williamr@2
|
989 |
@capability NetworkControl Restrict access to connection clients
|
williamr@2
|
990 |
@ref RConnection::Control()
|
williamr@2
|
991 |
*/
|
williamr@2
|
992 |
const TUint KCoEnumerateConnectionClients = 1 | (KConnWriteUserDataBit | KConnReadUserDataBit);
|
williamr@2
|
993 |
|
williamr@2
|
994 |
/**
|
williamr@2
|
995 |
Level for RConnection::Control()
|
williamr@2
|
996 |
Information about client
|
williamr@2
|
997 |
|
williamr@2
|
998 |
@publishedPartner
|
williamr@2
|
999 |
@deprecated in 8.1
|
williamr@2
|
1000 |
@capability NetworkControl Restrict access to connection client info
|
williamr@2
|
1001 |
@ref RConnection::Control()
|
williamr@2
|
1002 |
*/
|
williamr@2
|
1003 |
const TUint KCoGetConnectionClientInfo = 2 | (KConnWriteUserDataBit | KConnReadUserDataBit);
|
williamr@2
|
1004 |
|
williamr@2
|
1005 |
/** @internalTechnology */
|
williamr@2
|
1006 |
const TUint KCoEnumerateConnectionSockets = 3 | (KConnWriteUserDataBit | KConnReadUserDataBit);
|
williamr@2
|
1007 |
|
williamr@2
|
1008 |
/**
|
williamr@2
|
1009 |
Level for RConnection::Control()
|
williamr@2
|
1010 |
Information about connected socket
|
williamr@2
|
1011 |
|
williamr@2
|
1012 |
@publishedPartner
|
williamr@2
|
1013 |
@deprecated
|
williamr@2
|
1014 |
@capability NetworkControl Restrict access to socket info on a connection
|
williamr@2
|
1015 |
@ref RConnection::Control()
|
williamr@2
|
1016 |
*/
|
williamr@2
|
1017 |
const TUint KCoGetConnectionSocketInfo = 4 | (KConnWriteUserDataBit | KConnReadUserDataBit);
|
williamr@2
|
1018 |
|
williamr@2
|
1019 |
/**
|
williamr@2
|
1020 |
Default connection type
|
williamr@2
|
1021 |
@publishedAll
|
williamr@2
|
1022 |
@released
|
williamr@2
|
1023 |
*/
|
williamr@2
|
1024 |
const TUint KConnectionTypeDefault = 0x0800; // KAfInet is the default connection type
|
williamr@2
|
1025 |
|
williamr@2
|
1026 |
/**
|
williamr@2
|
1027 |
Setting only: enable processes to "clone" open this RConnection instance via a call to
|
williamr@2
|
1028 |
RConnection::Open(..., TName&), as long as they conform to the security policy
|
williamr@2
|
1029 |
passed as argument (specified as a TSecurityPolicyBuf).
|
williamr@2
|
1030 |
@internalTechnology
|
williamr@2
|
1031 |
*/
|
williamr@2
|
1032 |
const TUint KCoEnableCloneOpen = 5 | (KConnReadUserDataBit);
|
williamr@2
|
1033 |
|
williamr@2
|
1034 |
/**
|
williamr@2
|
1035 |
Setting only: disable "clone" open of this RConnection instance, which was enabled via
|
williamr@2
|
1036 |
a previous KCoEnableCloneOpen option.
|
williamr@2
|
1037 |
@internalTechnology
|
williamr@2
|
1038 |
*/
|
williamr@2
|
1039 |
const TUint KCoDisableCloneOpen = 6 | (KConnReadUserDataBit);
|
williamr@2
|
1040 |
|
williamr@2
|
1041 |
class TConnPref;
|
williamr@2
|
1042 |
class TSubConnectionInfo;
|
williamr@2
|
1043 |
class TSubConnectionEvent;
|
williamr@2
|
1044 |
|
williamr@2
|
1045 |
class RConnection : public RCommsSubSession
|
williamr@2
|
1046 |
/**
|
williamr@2
|
1047 |
|
williamr@2
|
1048 |
The management interface for a network connection or subconnection.
|
williamr@2
|
1049 |
|
williamr@2
|
1050 |
Provides clients with the following functionality:
|
williamr@2
|
1051 |
|
williamr@2
|
1052 |
Opening and closing the connection
|
williamr@2
|
1053 |
|
williamr@2
|
1054 |
Starting a connection, which means associating it with a new underlying interface
|
williamr@2
|
1055 |
|
williamr@2
|
1056 |
Attaching the RConnection instance to an existing interface
|
williamr@2
|
1057 |
|
williamr@2
|
1058 |
Stopping the connection, which means disassociating it from the underlying
|
williamr@2
|
1059 |
interface
|
williamr@2
|
1060 |
|
williamr@2
|
1061 |
Obtaining progress information and notification during connection start-up
|
williamr@2
|
1062 |
|
williamr@2
|
1063 |
Notifying when subconnections come up and go down
|
williamr@2
|
1064 |
|
williamr@2
|
1065 |
Notifying when there is a service change for the connection
|
williamr@2
|
1066 |
|
williamr@2
|
1067 |
Notifying when a given amount of data has been sent or received on a connection
|
williamr@2
|
1068 |
or subconnection
|
williamr@2
|
1069 |
|
williamr@2
|
1070 |
Reading CommDB fields specific to an active connection
|
williamr@2
|
1071 |
|
williamr@2
|
1072 |
Collecting statistical information on the network connection and subconnections.
|
williamr@2
|
1073 |
A UI component can display the collected statistical information in order
|
williamr@2
|
1074 |
to allow the user to examine the status of connections. The information that
|
williamr@2
|
1075 |
can be gathered is the following:
|
williamr@2
|
1076 |
|
williamr@2
|
1077 |
All available internet access point names and internet access point 'friendly'
|
williamr@2
|
1078 |
names as appropriate for each network (GPRS/UMTS) connection
|
williamr@2
|
1079 |
|
williamr@2
|
1080 |
Enumerating the currently active connections and subconnections
|
williamr@2
|
1081 |
|
williamr@2
|
1082 |
The current status of all network connections e.g. active/suspended
|
williamr@2
|
1083 |
|
williamr@2
|
1084 |
The amount of data (in bytes) transferred uplink and downlink by the network
|
williamr@2
|
1085 |
connection and subconnections
|
williamr@2
|
1086 |
|
williamr@2
|
1087 |
The amount of time each network connection has been active (in seconds)
|
williamr@2
|
1088 |
|
williamr@2
|
1089 |
The current status of the connection and subconnections with respect to data
|
williamr@2
|
1090 |
transfer, i.e. active/inactive
|
williamr@2
|
1091 |
|
williamr@2
|
1092 |
The Quality of Service profile associated with each Packet Data Protocol (GPRS/UMTS)
|
williamr@2
|
1093 |
context, e.g. low/medium/high
|
williamr@2
|
1094 |
|
williamr@2
|
1095 |
Note that several of the new functions are asynchronous. It is essential for
|
williamr@2
|
1096 |
these calls that the client ensures that the parameters they pass to the RConnection
|
williamr@2
|
1097 |
API remain in scope for the duration of the asynchronous call.
|
williamr@2
|
1098 |
@publishedAll
|
williamr@2
|
1099 |
@released since v7.0s */
|
williamr@2
|
1100 |
{
|
williamr@2
|
1101 |
public:
|
williamr@2
|
1102 |
/** Identifies the intended use of the connection. */
|
williamr@2
|
1103 |
enum TConnAttachType
|
williamr@2
|
1104 |
{
|
williamr@2
|
1105 |
/** The application wishes to use the connection for normal data transfer, and
|
williamr@2
|
1106 |
the idle timers will take that into account. */
|
williamr@2
|
1107 |
EAttachTypeNormal,
|
williamr@2
|
1108 |
/** The system control type of application wishes to monitor the state of the connection
|
williamr@2
|
1109 |
without otherwise affecting it. In particular, the interface idle timers will
|
williamr@2
|
1110 |
not be affected. */
|
williamr@2
|
1111 |
EAttachTypeMonitor
|
williamr@2
|
1112 |
};
|
williamr@2
|
1113 |
/** Identifies the type of requirement for stopping the connection. */
|
williamr@2
|
1114 |
enum TConnStopType
|
williamr@2
|
1115 |
{
|
williamr@2
|
1116 |
/** Any sockets or host/service resolvers associated with this interface will be
|
williamr@2
|
1117 |
errored with KErrCancel. */
|
williamr@2
|
1118 |
|
williamr@2
|
1119 |
EStopNormal,
|
williamr@2
|
1120 |
|
williamr@2
|
1121 |
/** Any sockets or host/service resolvers associated with this interface will be
|
williamr@2
|
1122 |
errored with KErrConnectionTerminated and should clean up quietly without
|
williamr@2
|
1123 |
prompting the user. */
|
williamr@2
|
1124 |
|
williamr@2
|
1125 |
EStopAuthoritative
|
williamr@2
|
1126 |
};
|
williamr@2
|
1127 |
|
williamr@2
|
1128 |
/**
|
williamr@2
|
1129 |
Connection Management Interface
|
williamr@2
|
1130 |
*/
|
williamr@2
|
1131 |
IMPORT_C RConnection();
|
williamr@2
|
1132 |
IMPORT_C virtual ~RConnection();
|
williamr@2
|
1133 |
IMPORT_C TInt Open(RSocketServ& aSocketServer, TUint aConnectionType = KConnectionTypeDefault);
|
williamr@2
|
1134 |
IMPORT_C TInt Open(RSocketServ& aSocketServer, TName& aName);
|
williamr@2
|
1135 |
IMPORT_C void Close();
|
williamr@2
|
1136 |
|
williamr@2
|
1137 |
IMPORT_C void Start(TRequestStatus& aStatus);
|
williamr@2
|
1138 |
IMPORT_C void Start(TConnPref& aPref, TRequestStatus& aStatus);
|
williamr@2
|
1139 |
IMPORT_C TInt Start();
|
williamr@2
|
1140 |
IMPORT_C TInt Start(TConnPref& aPref);
|
williamr@2
|
1141 |
IMPORT_C TInt Stop();
|
williamr@2
|
1142 |
IMPORT_C TInt Stop(TConnStopType aStopType);
|
williamr@2
|
1143 |
IMPORT_C TInt Stop(TSubConnectionUniqueId aSubConnectionUniqueId);
|
williamr@2
|
1144 |
IMPORT_C TInt Stop(TSubConnectionUniqueId aSubConnectionUniqueId, TConnStopType aStopType);
|
williamr@2
|
1145 |
|
williamr@2
|
1146 |
IMPORT_C void WaitForIncoming(RSubConnection& aIncomingSubConnection, TRequestStatus& aStatus);
|
williamr@2
|
1147 |
IMPORT_C TInt WaitForIncoming(RSubConnection& aIncomingSubConnection);
|
williamr@2
|
1148 |
IMPORT_C void CancelWaitForIncoming();
|
williamr@2
|
1149 |
|
williamr@2
|
1150 |
IMPORT_C void ProgressNotification(TNifProgressBuf& aProgress, TRequestStatus& aStatus, TUint aSelectedProgress = KConnProgressDefault);
|
williamr@2
|
1151 |
IMPORT_C void ProgressNotification(TSubConnectionUniqueId aSubConnectionUniqueId, TNifProgressBuf& aProgress, TRequestStatus& aStatus, TUint aSelectedProgress = KConnProgressDefault);
|
williamr@2
|
1152 |
IMPORT_C void CancelProgressNotification();
|
williamr@2
|
1153 |
IMPORT_C void CancelProgressNotification(TSubConnectionUniqueId aSubConnectionUniqueId);
|
williamr@2
|
1154 |
IMPORT_C TInt Progress(TNifProgress& aProgress);
|
williamr@2
|
1155 |
IMPORT_C TInt Progress(TSubConnectionUniqueId aSubConnectionUniqueId, TNifProgress& aProgress);
|
williamr@2
|
1156 |
IMPORT_C TInt LastProgressError(TNifProgress& aProgress);
|
williamr@2
|
1157 |
IMPORT_C void ServiceChangeNotification(TUint32& aNewISPId, TDes& aNewServiceType, TRequestStatus& aStatus);
|
williamr@2
|
1158 |
IMPORT_C void CancelServiceChangeNotification();
|
williamr@2
|
1159 |
|
williamr@2
|
1160 |
IMPORT_C TInt GetIntSetting(const TDesC& aSettingName, TUint32& aValue);
|
williamr@2
|
1161 |
IMPORT_C TInt GetBoolSetting(const TDesC& aSettingName, TBool& aValue);
|
williamr@2
|
1162 |
IMPORT_C TInt GetDesSetting(const TDesC& aSettingName, TDes8& aValue);
|
williamr@2
|
1163 |
IMPORT_C TInt GetDesSetting(const TDesC& aSettingName, TDes16& aValue);
|
williamr@2
|
1164 |
IMPORT_C TInt GetLongDesSetting(const TDesC& aSettingName, TDes& aValue);
|
williamr@2
|
1165 |
|
williamr@2
|
1166 |
|
williamr@2
|
1167 |
/**
|
williamr@2
|
1168 |
@prototype SymbianOS v9.4
|
williamr@2
|
1169 |
*/
|
williamr@2
|
1170 |
IMPORT_C TInt GetParameters(ESock::CCommsDataObjectBase& aDataObject);
|
williamr@2
|
1171 |
|
williamr@2
|
1172 |
IMPORT_C TInt Name(TName& aName);
|
williamr@2
|
1173 |
|
williamr@2
|
1174 |
IMPORT_C TInt EnumerateConnections(TUint& aCount);
|
williamr@2
|
1175 |
IMPORT_C TInt GetConnectionInfo(TUint aIndex, TDes8& aConnectionInfo);
|
williamr@2
|
1176 |
|
williamr@2
|
1177 |
IMPORT_C void AllInterfaceNotification(TDes8& aNotification, TRequestStatus& aStatus);
|
williamr@2
|
1178 |
IMPORT_C void CancelAllInterfaceNotification();
|
williamr@2
|
1179 |
|
williamr@2
|
1180 |
IMPORT_C void Ioctl(TUint aOptionLevel, TUint aOptionName, TRequestStatus& aStatus, TDes8* aDesc);
|
williamr@2
|
1181 |
IMPORT_C void Ioctl(TUint aOptionLevel, TUint aOptionName, TRequestStatus& aStatus);
|
williamr@2
|
1182 |
IMPORT_C void CancelIoctl();
|
williamr@2
|
1183 |
IMPORT_C TInt Control(TUint aOptionLevel, TUint aOptionName, TDes8& aOption);
|
williamr@2
|
1184 |
IMPORT_C TInt GetOpt(TUint aOptionLevel, TUint aOptionName, TInt& aOption);
|
williamr@2
|
1185 |
IMPORT_C TInt SetOpt(TUint aOptionLevel, TUint aOptionName, TInt aOption = 0);
|
williamr@2
|
1186 |
|
williamr@2
|
1187 |
IMPORT_C TInt Attach(const TDesC8& aConnectionInfo, TConnAttachType aAttachType);
|
williamr@2
|
1188 |
|
williamr@2
|
1189 |
IMPORT_C TInt EnumerateSubConnections(TUint& aCount);
|
williamr@2
|
1190 |
IMPORT_C TInt GetSubConnectionInfo(TDes8& aSubConnectionInfo);
|
williamr@2
|
1191 |
IMPORT_C TInt GetSubConnectionInfo(TUint aIndex, TDes8& aSubConnectionInfo);
|
williamr@2
|
1192 |
IMPORT_C void AllSubConnectionNotification(TSubConnectionNotificationBuf& aSubConnectionEvent, TRequestStatus& aStatus);
|
williamr@2
|
1193 |
IMPORT_C void CancelAllSubConnectionNotification();
|
williamr@2
|
1194 |
|
williamr@2
|
1195 |
IMPORT_C void DataTransferredRequest(TPckg<TUint>& aUplinkVolume, TPckg<TUint>& aDownlinkVolume, TRequestStatus& aStatus);
|
williamr@2
|
1196 |
IMPORT_C void DataTransferredRequest(TSubConnectionUniqueId aSubConnectionUniqueId, TPckg<TUint>& aUplinkVolume, TPckg<TUint>& aDownlinkVolume, TRequestStatus& aStatus);
|
williamr@2
|
1197 |
IMPORT_C void DataTransferredCancel();
|
williamr@2
|
1198 |
IMPORT_C void DataTransferredCancel(TSubConnectionUniqueId aSubConnectionUniqueId);
|
williamr@2
|
1199 |
IMPORT_C void DataSentNotificationRequest(TUint aThreshold, TPckg<TUint>& aUplinkVolume, TRequestStatus& aStatus);
|
williamr@2
|
1200 |
IMPORT_C void DataSentNotificationRequest(TSubConnectionUniqueId aSubConnectionUniqueId, TUint aThreshold, TPckg<TUint>& aUplinkVolume, TRequestStatus& aStatus);
|
williamr@2
|
1201 |
IMPORT_C void DataSentNotificationCancel();
|
williamr@2
|
1202 |
IMPORT_C void DataSentNotificationCancel(TSubConnectionUniqueId aSubConnectionUniqueId);
|
williamr@2
|
1203 |
IMPORT_C void DataReceivedNotificationRequest(TUint aThreshold, TPckg<TUint>& aDownlinkVolume, TRequestStatus& aStatus);
|
williamr@2
|
1204 |
IMPORT_C void DataReceivedNotificationRequest(TSubConnectionUniqueId aSubConnectionUniqueId, TUint aThreshold, TPckg<TUint>& aDownlinkVolume, TRequestStatus& aStatus);
|
williamr@2
|
1205 |
IMPORT_C void DataReceivedNotificationCancel();
|
williamr@2
|
1206 |
IMPORT_C void DataReceivedNotificationCancel(TSubConnectionUniqueId aSubConnectionUniqueId);
|
williamr@2
|
1207 |
IMPORT_C void IsConnectionActiveRequest(TUint aSecs, TPckg<TBool>& aState, TRequestStatus& aStatus);
|
williamr@2
|
1208 |
IMPORT_C void IsConnectionActiveCancel();
|
williamr@2
|
1209 |
IMPORT_C void IsSubConnectionActiveRequest(TSubConnectionUniqueId aSubConnectionUniqueId, TUint aSecs, TPckg<TBool>& aState, TRequestStatus& aStatus);
|
williamr@2
|
1210 |
IMPORT_C void IsSubConnectionActiveCancel(TSubConnectionUniqueId aSubConnectionUniqueId);
|
williamr@2
|
1211 |
|
williamr@2
|
1212 |
TBool SameSession(TInt aSessionHandle);
|
williamr@2
|
1213 |
private:
|
williamr@2
|
1214 |
TPckg<TUint32> iNewISPId;
|
williamr@2
|
1215 |
TUint32 iReserved[4];
|
williamr@2
|
1216 |
};
|
williamr@2
|
1217 |
|
williamr@2
|
1218 |
class CSubConParameterSet : public SMetaDataECom
|
williamr@2
|
1219 |
/** Base class for all RSubConnection parameter sets.
|
williamr@2
|
1220 |
|
williamr@2
|
1221 |
@publishedAll
|
williamr@2
|
1222 |
@released since v9.0 */
|
williamr@2
|
1223 |
{
|
williamr@2
|
1224 |
public:
|
williamr@2
|
1225 |
IMPORT_C static CSubConParameterSet* NewL(const STypeId& aTypeId);
|
williamr@2
|
1226 |
virtual ~CSubConParameterSet();
|
williamr@2
|
1227 |
|
williamr@2
|
1228 |
protected:
|
williamr@2
|
1229 |
CSubConParameterSet();
|
williamr@2
|
1230 |
};
|
williamr@2
|
1231 |
|
williamr@2
|
1232 |
|
williamr@2
|
1233 |
class CSubConGenericParameterSet : public CSubConParameterSet
|
williamr@2
|
1234 |
/** Base class for generic RSubConnection parameter sets.
|
williamr@2
|
1235 |
|
williamr@2
|
1236 |
@publishedAll
|
williamr@2
|
1237 |
@released since v9.0 */
|
williamr@2
|
1238 |
{
|
williamr@2
|
1239 |
public:
|
williamr@2
|
1240 |
IMPORT_C ~CSubConGenericParameterSet();
|
williamr@2
|
1241 |
|
williamr@2
|
1242 |
protected:
|
williamr@2
|
1243 |
IMPORT_C CSubConGenericParameterSet();
|
williamr@2
|
1244 |
};
|
williamr@2
|
1245 |
|
williamr@2
|
1246 |
class CSubConExtensionParameterSet : public CSubConParameterSet
|
williamr@2
|
1247 |
/** Base class for extended RSubConnection parameter sets.
|
williamr@2
|
1248 |
|
williamr@2
|
1249 |
@publishedAll
|
williamr@2
|
1250 |
@released since v9.0 */
|
williamr@2
|
1251 |
{
|
williamr@2
|
1252 |
public:
|
williamr@2
|
1253 |
IMPORT_C ~CSubConExtensionParameterSet();
|
williamr@2
|
1254 |
|
williamr@2
|
1255 |
protected:
|
williamr@2
|
1256 |
IMPORT_C CSubConExtensionParameterSet();
|
williamr@2
|
1257 |
};
|
williamr@2
|
1258 |
|
williamr@2
|
1259 |
class RSubConParameterBundle;
|
williamr@2
|
1260 |
class CSubConParameterBundle;
|
williamr@2
|
1261 |
|
williamr@2
|
1262 |
const TInt32 KSubConnParamsInterfaceUid = 0x10204303;
|
williamr@2
|
1263 |
const TInt32 KSubConnEventInterfaceUid = 0x10204305;
|
williamr@2
|
1264 |
|
williamr@2
|
1265 |
const TInt32 KSubConnGenericParamsImplUid = 0x10204304;
|
williamr@2
|
1266 |
const TInt32 KSubConnGenericEventsImplUid = 0x10204306;
|
williamr@2
|
1267 |
|
williamr@2
|
1268 |
const TUint32 KSubConGlobalFamily = 0;
|
williamr@2
|
1269 |
const TUint32 KSubConQoSFamily = 1;
|
williamr@2
|
1270 |
const TUint32 KSubConAuthorisationFamily = 2;
|
williamr@2
|
1271 |
const TUint32 KSubConnCallDescrParamsFamily = 3;
|
williamr@2
|
1272 |
#ifdef SYMBIAN_NETWORKING_UMTSR5
|
williamr@2
|
1273 |
const TUint32 KSubConnContextDescrParamsFamily = 4;
|
williamr@2
|
1274 |
#endif //SYMBIAN_NETWORKING_UMTSR5
|
williamr@2
|
1275 |
|
williamr@2
|
1276 |
class CSubConParameterFamily : public CBase
|
williamr@2
|
1277 |
/** Container of RSubConnection parameter sets.
|
williamr@2
|
1278 |
|
williamr@2
|
1279 |
For each Parameter Type (Requested, Acceptable and Granted) it
|
williamr@2
|
1280 |
contains one generic and 0..N extended parameter sets.
|
williamr@2
|
1281 |
|
williamr@2
|
1282 |
@publishedAll
|
williamr@2
|
1283 |
@released since v9.0 */
|
williamr@2
|
1284 |
{
|
williamr@2
|
1285 |
public:
|
williamr@2
|
1286 |
|
williamr@2
|
1287 |
enum TParameterSetType
|
williamr@2
|
1288 |
{
|
williamr@2
|
1289 |
ERequested = 0,
|
williamr@2
|
1290 |
EAcceptable = 1,
|
williamr@2
|
1291 |
EGranted = 2,
|
williamr@2
|
1292 |
ENumValues = 3 // The number of values in this enum
|
williamr@2
|
1293 |
};
|
williamr@2
|
1294 |
|
williamr@2
|
1295 |
public:
|
williamr@2
|
1296 |
IMPORT_C static CSubConParameterFamily* NewL(RSubConParameterBundle& aBundle, TUint32 aFamilyId);
|
williamr@2
|
1297 |
IMPORT_C static CSubConParameterFamily* LoadL(RSubConParameterBundle& aBundle, TPtrC8& aBuffer);
|
williamr@2
|
1298 |
IMPORT_C static CSubConParameterFamily* NewL(CSubConParameterBundle& aBundle, TUint32 aFamilyId);
|
williamr@2
|
1299 |
IMPORT_C static CSubConParameterFamily* LoadL(CSubConParameterBundle& aBundle, TPtrC8& aBuffer);
|
williamr@2
|
1300 |
|
williamr@2
|
1301 |
public:
|
williamr@2
|
1302 |
IMPORT_C virtual ~CSubConParameterFamily();
|
williamr@2
|
1303 |
IMPORT_C void SetGenericSetL(CSubConGenericParameterSet& aGenericSet, TParameterSetType aType);
|
williamr@2
|
1304 |
IMPORT_C void AddExtensionSetL(CSubConExtensionParameterSet& aExtensionSet, TParameterSetType aType);
|
williamr@2
|
1305 |
|
williamr@2
|
1306 |
IMPORT_C CSubConExtensionParameterSet* FindExtensionSet(TUid aSetId, TParameterSetType aType);
|
williamr@2
|
1307 |
IMPORT_C CSubConExtensionParameterSet* FindExtensionSet(STypeId aSetId, TParameterSetType aType);
|
williamr@2
|
1308 |
IMPORT_C CSubConGenericParameterSet* GetGenericSet(TParameterSetType aType);
|
williamr@2
|
1309 |
|
williamr@2
|
1310 |
inline TUint32 Id();
|
williamr@2
|
1311 |
|
williamr@2
|
1312 |
IMPORT_C TUint Length() const;
|
williamr@2
|
1313 |
IMPORT_C TInt Load(TPtrC8& aDes);
|
williamr@2
|
1314 |
IMPORT_C TInt Store(TDes8& aDes) const;
|
williamr@2
|
1315 |
IMPORT_C void ClearAllParameters(TParameterSetType aType);
|
williamr@2
|
1316 |
|
williamr@2
|
1317 |
protected:
|
williamr@2
|
1318 |
explicit CSubConParameterFamily(TUint32 aFamilyId);
|
williamr@2
|
1319 |
void ConstructL(RSubConParameterBundle& aBundle);
|
williamr@2
|
1320 |
void ConstructL(CSubConParameterBundle& aBundle);
|
williamr@2
|
1321 |
|
williamr@2
|
1322 |
static TInt32 ExtractFamilyAndCreateBufferL(TPtrC8& aBuffer, TPtrC8& aContainerBuffer);
|
williamr@2
|
1323 |
|
williamr@2
|
1324 |
private:
|
williamr@2
|
1325 |
const TUint32 iFamilyId;
|
williamr@2
|
1326 |
RMetaDataEComContainer iGenericSets;
|
williamr@2
|
1327 |
RMetaDataEComContainer iExtensionSets[ENumValues];
|
williamr@2
|
1328 |
};
|
williamr@2
|
1329 |
|
williamr@2
|
1330 |
class CSubConParameterBundle : public CObject
|
williamr@2
|
1331 |
/** Container for (bundle of) SubConnection parameter families.
|
williamr@2
|
1332 |
|
williamr@2
|
1333 |
May contain and 0..N parameter families.
|
williamr@2
|
1334 |
|
williamr@2
|
1335 |
@publishedPartner
|
williamr@2
|
1336 |
@released since v9.0 */
|
williamr@2
|
1337 |
{
|
williamr@2
|
1338 |
public:
|
williamr@2
|
1339 |
IMPORT_C static CSubConParameterBundle* NewL();
|
williamr@2
|
1340 |
IMPORT_C static CSubConParameterBundle* LoadL(TDesC8& aDes);
|
williamr@2
|
1341 |
|
williamr@2
|
1342 |
IMPORT_C ~CSubConParameterBundle();
|
williamr@2
|
1343 |
|
williamr@2
|
1344 |
IMPORT_C TUint Length() const;
|
williamr@2
|
1345 |
IMPORT_C TInt Load(const TDesC8& aDes);
|
williamr@2
|
1346 |
IMPORT_C TInt Store(TDes8& aDes) const;
|
williamr@2
|
1347 |
IMPORT_C void AddFamilyL(CSubConParameterFamily* aFamily);
|
williamr@2
|
1348 |
IMPORT_C CSubConParameterFamily* FindFamily(TUint32 aFamilyId);
|
williamr@2
|
1349 |
IMPORT_C void ClearAllParameters(CSubConParameterFamily::TParameterSetType aType);
|
williamr@2
|
1350 |
|
williamr@2
|
1351 |
protected:
|
williamr@2
|
1352 |
CSubConParameterBundle();
|
williamr@2
|
1353 |
|
williamr@2
|
1354 |
private:
|
williamr@2
|
1355 |
CSubConParameterBundle(const CSubConParameterBundle& aBundle);
|
williamr@2
|
1356 |
CSubConParameterBundle& operator=(const CSubConParameterBundle& aBundle);
|
williamr@2
|
1357 |
|
williamr@2
|
1358 |
private:
|
williamr@2
|
1359 |
RPointerArray<CSubConParameterFamily> iFamilies;
|
williamr@2
|
1360 |
};
|
williamr@2
|
1361 |
|
williamr@2
|
1362 |
class RSubConParameterBundle
|
williamr@2
|
1363 |
/** Container for (bundle of) SubConnection parameter families.
|
williamr@2
|
1364 |
|
williamr@2
|
1365 |
May contain and 0..N SubConnection parameter families.
|
williamr@2
|
1366 |
|
williamr@2
|
1367 |
|
williamr@2
|
1368 |
@publishedAll
|
williamr@2
|
1369 |
@released since v9.0 */
|
williamr@2
|
1370 |
{
|
williamr@2
|
1371 |
public:
|
williamr@2
|
1372 |
IMPORT_C RSubConParameterBundle();
|
williamr@2
|
1373 |
IMPORT_C void Close();
|
williamr@2
|
1374 |
|
williamr@2
|
1375 |
IMPORT_C TUint Length() const;
|
williamr@2
|
1376 |
IMPORT_C TInt Load(const TDesC8& aDes);
|
williamr@2
|
1377 |
IMPORT_C TInt Store(TDes8& aDes) const;
|
williamr@2
|
1378 |
IMPORT_C void AddFamilyL(CSubConParameterFamily* aFamily);
|
williamr@2
|
1379 |
IMPORT_C CSubConParameterFamily* FindFamily(TUint32 aFamilyId);
|
williamr@2
|
1380 |
IMPORT_C void ClearAllParameters(CSubConParameterFamily::TParameterSetType aType);
|
williamr@2
|
1381 |
|
williamr@2
|
1382 |
protected:
|
williamr@2
|
1383 |
TInt CheckBundle() const;
|
williamr@2
|
1384 |
private:
|
williamr@2
|
1385 |
RSubConParameterBundle(const RSubConParameterBundle& aBundle);
|
williamr@2
|
1386 |
RSubConParameterBundle& operator=(const RSubConParameterBundle& aBundle);
|
williamr@2
|
1387 |
|
williamr@2
|
1388 |
private:
|
williamr@2
|
1389 |
mutable CSubConParameterBundle* iBundle;
|
williamr@2
|
1390 |
};
|
williamr@2
|
1391 |
|
williamr@2
|
1392 |
const TInt KNotificationEventMaxSize = 2048;
|
williamr@2
|
1393 |
class TNotificationEventBuf : public TBuf8<KNotificationEventMaxSize>
|
williamr@2
|
1394 |
/**
|
williamr@2
|
1395 |
Buffer for Sub-connection event notiifcation
|
williamr@2
|
1396 |
|
williamr@2
|
1397 |
@publishedAll
|
williamr@2
|
1398 |
@released
|
williamr@2
|
1399 |
*/
|
williamr@2
|
1400 |
{
|
williamr@2
|
1401 |
public:
|
williamr@2
|
1402 |
IMPORT_C TNotificationEventBuf();
|
williamr@2
|
1403 |
IMPORT_C ~TNotificationEventBuf();
|
williamr@2
|
1404 |
|
williamr@2
|
1405 |
IMPORT_C TBool IsGeneric() const;
|
williamr@2
|
1406 |
IMPORT_C TInt32 GroupId() const;
|
williamr@2
|
1407 |
IMPORT_C TUint32 Id() const;
|
williamr@2
|
1408 |
};
|
williamr@2
|
1409 |
|
williamr@2
|
1410 |
class CSubConNotificationEvent : public SMetaDataECom
|
williamr@2
|
1411 |
{
|
williamr@2
|
1412 |
public:
|
williamr@2
|
1413 |
IMPORT_C static CSubConNotificationEvent* NewL(const STypeId& aTypeId);
|
williamr@2
|
1414 |
IMPORT_C static CSubConNotificationEvent* NewL(const TNotificationEventBuf& aEventBuffer);
|
williamr@2
|
1415 |
|
williamr@2
|
1416 |
IMPORT_C TBool IsGeneric() const;
|
williamr@2
|
1417 |
IMPORT_C TInt32 GroupId() const;
|
williamr@2
|
1418 |
IMPORT_C TUint32 Id() const;
|
williamr@2
|
1419 |
|
williamr@2
|
1420 |
private:
|
williamr@2
|
1421 |
};
|
williamr@2
|
1422 |
|
williamr@2
|
1423 |
class TSubConnOpen
|
williamr@2
|
1424 |
/** @internalComponent */
|
williamr@2
|
1425 |
{
|
williamr@2
|
1426 |
public:
|
williamr@2
|
1427 |
/** Defines the type of a subconnection */
|
williamr@2
|
1428 |
enum TSubConnType
|
williamr@2
|
1429 |
{
|
williamr@2
|
1430 |
EAttachToDefault, // will attach to the default sub connection
|
williamr@2
|
1431 |
ECreateNew, // will create a new sub connection
|
williamr@2
|
1432 |
|
williamr@2
|
1433 |
//private extension to subconnection openning modes below:
|
williamr@2
|
1434 |
EWaitForIncoming
|
williamr@2
|
1435 |
};
|
williamr@2
|
1436 |
|
williamr@2
|
1437 |
TSubConnType iType;
|
williamr@2
|
1438 |
TInt iHandle;
|
williamr@2
|
1439 |
TInt iReserved;
|
williamr@2
|
1440 |
};
|
williamr@2
|
1441 |
|
williamr@2
|
1442 |
class RSubConnection : public RSubSessionBase
|
williamr@2
|
1443 |
/** A Sub-Connection, a channel within a Connection. A representation of a channel between this device and remote devices with which we are communicating. This channel will be used by one or more sockets.
|
williamr@2
|
1444 |
Depending on the state of the channel, it may not be possible to bind arbitary sockets into it. Attempts to bind sockets from different protocol families to a single channel is an error, as each channel can only be used by one protocol family.
|
williamr@2
|
1445 |
@note The sub-connection can represent a end-to-end channel and/or a channel from this device to an intermediate device (e.g an access server such as a GGSN which using UMTS and PDP contexts. Properties can be specified simultaneously on protocol and link level.
|
williamr@2
|
1446 |
|
williamr@2
|
1447 |
Before using any of these services, a connection to a socket server session
|
williamr@2
|
1448 |
must have been made and the connection must be open.
|
williamr@2
|
1449 |
|
williamr@2
|
1450 |
@publishedAll
|
williamr@2
|
1451 |
@released Since v9.0*/
|
williamr@2
|
1452 |
{
|
williamr@2
|
1453 |
public:
|
williamr@2
|
1454 |
friend class RConnection;
|
williamr@2
|
1455 |
|
williamr@2
|
1456 |
enum TSubConnType
|
williamr@2
|
1457 |
{
|
williamr@2
|
1458 |
EAttachToDefault,
|
williamr@2
|
1459 |
ECreateNew
|
williamr@2
|
1460 |
};
|
williamr@2
|
1461 |
|
williamr@2
|
1462 |
struct TEventFilter
|
williamr@2
|
1463 |
{
|
williamr@2
|
1464 |
inline TEventFilter(TInt32 aEventGroupId = KSubConnGenericEventsImplUid, TUint32 aEventMask = 0xffffffff);
|
williamr@2
|
1465 |
TInt32 iEventGroupUid;
|
williamr@2
|
1466 |
TUint32 iEventMask;
|
williamr@2
|
1467 |
};
|
williamr@2
|
1468 |
|
williamr@2
|
1469 |
public:
|
williamr@2
|
1470 |
// Sub Connection Management
|
williamr@2
|
1471 |
IMPORT_C RSubConnection();
|
williamr@2
|
1472 |
IMPORT_C TInt Open(RSocketServ& aServer, TSubConnType aSubConnType, RConnection& aConnection);
|
williamr@2
|
1473 |
IMPORT_C void Close();
|
williamr@2
|
1474 |
IMPORT_C void Start(TRequestStatus& aStatus);
|
williamr@2
|
1475 |
IMPORT_C TInt Start();
|
williamr@2
|
1476 |
IMPORT_C TInt Stop();
|
williamr@2
|
1477 |
|
williamr@2
|
1478 |
// Socket Management
|
williamr@2
|
1479 |
IMPORT_C void Add(RSocket& aSocket, TRequestStatus& aStatus);
|
williamr@2
|
1480 |
IMPORT_C void Remove(RSocket& aSocket, TRequestStatus& aStatus);
|
williamr@2
|
1481 |
|
williamr@2
|
1482 |
// QoS Properties
|
williamr@2
|
1483 |
IMPORT_C TInt SetParameters(const RSubConParameterBundle& aParametersSet);
|
williamr@2
|
1484 |
IMPORT_C TInt GetParameters(RSubConParameterBundle& aParametersSet);
|
williamr@2
|
1485 |
|
williamr@2
|
1486 |
// Event Notification
|
williamr@2
|
1487 |
IMPORT_C void EventNotification(TNotificationEventBuf& aEventBuffer, TBool aGenericEventsOnly, TRequestStatus& aStatus);
|
williamr@2
|
1488 |
IMPORT_C void EventNotification(TNotificationEventBuf& aEventBuffer, TEventFilter aEventFilterList[], TUint aEventListLength, TRequestStatus& aStatus);
|
williamr@2
|
1489 |
IMPORT_C void CancelEventNotification();
|
williamr@2
|
1490 |
|
williamr@2
|
1491 |
// Generic Control
|
williamr@2
|
1492 |
IMPORT_C TInt Control(TUint aOptionLevel, TUint aOptionName, TDes8& aOption);
|
williamr@2
|
1493 |
|
williamr@2
|
1494 |
TBool SameSession(TInt aSessionHandle);
|
williamr@2
|
1495 |
|
williamr@2
|
1496 |
private:
|
williamr@2
|
1497 |
IMPORT_C TInt Open(RSocketServ& aServer, TSubConnOpen::TSubConnType aSubConnType, RConnection& aConnection);
|
williamr@2
|
1498 |
|
williamr@2
|
1499 |
//Note : Not used anywhere else in the code, kept in order to avoid the BC Break
|
williamr@2
|
1500 |
TInt iSpare;
|
williamr@2
|
1501 |
};
|
williamr@2
|
1502 |
|
williamr@2
|
1503 |
|
williamr@2
|
1504 |
class ByteOrder
|
williamr@2
|
1505 |
/** Reverses the byte order in 16 and 32-bit values.
|
williamr@2
|
1506 |
@publishedAll
|
williamr@2
|
1507 |
@released */
|
williamr@2
|
1508 |
{
|
williamr@2
|
1509 |
public:
|
williamr@2
|
1510 |
IMPORT_C static TUint32 Swap32(TUint32 aVal);
|
williamr@2
|
1511 |
IMPORT_C static TUint16 Swap16(TUint16 aVal);
|
williamr@2
|
1512 |
inline static TUint16 Swap16(TUint aVal);
|
williamr@2
|
1513 |
};
|
williamr@2
|
1514 |
|
williamr@2
|
1515 |
class BigEndian
|
williamr@2
|
1516 |
/** Inserts and extracts integers in big-endian format.
|
williamr@2
|
1517 |
@publishedAll
|
williamr@2
|
1518 |
@released */
|
williamr@2
|
1519 |
{
|
williamr@2
|
1520 |
public:
|
williamr@2
|
1521 |
IMPORT_C static TUint32 Get32(const TUint8* aPtr);
|
williamr@2
|
1522 |
IMPORT_C static TUint16 Get16(const TUint8* aPtr);
|
williamr@2
|
1523 |
IMPORT_C static void Put32(TUint8* aPtr, TUint32 aVal);
|
williamr@2
|
1524 |
IMPORT_C static void Put16(TUint8* aPtr, TUint16 aVal);
|
williamr@2
|
1525 |
};
|
williamr@2
|
1526 |
|
williamr@2
|
1527 |
class LittleEndian
|
williamr@2
|
1528 |
/** Inserts and extracts integers in little-endian format.
|
williamr@2
|
1529 |
@publishedAll
|
williamr@2
|
1530 |
@released */
|
williamr@2
|
1531 |
{
|
williamr@2
|
1532 |
public:
|
williamr@2
|
1533 |
IMPORT_C static TUint32 Get32(const TUint8* aPtr);
|
williamr@2
|
1534 |
IMPORT_C static TUint16 Get16(const TUint8* aPtr);
|
williamr@2
|
1535 |
IMPORT_C static void Put32(TUint8* aPtr, TUint32 aVal);
|
williamr@2
|
1536 |
IMPORT_C static void Put16(TUint8* aPtr, TUint16 aVal);
|
williamr@2
|
1537 |
};
|
williamr@2
|
1538 |
|
williamr@2
|
1539 |
class TAccessPointInfo
|
williamr@2
|
1540 |
/** Stores Access Point information.
|
williamr@2
|
1541 |
@publishedAll */
|
williamr@2
|
1542 |
{
|
williamr@2
|
1543 |
public:
|
williamr@2
|
1544 |
TAccessPointInfo(TUint aApId = 0);
|
williamr@2
|
1545 |
|
williamr@2
|
1546 |
TUint AccessPoint() const;
|
williamr@2
|
1547 |
void SetAccessPoint(TUint aAccessPoint);
|
williamr@2
|
1548 |
|
williamr@2
|
1549 |
TBool operator== (const TAccessPointInfo& aRhs) const;
|
williamr@2
|
1550 |
private:
|
williamr@2
|
1551 |
TUint iAccessPointId;
|
williamr@2
|
1552 |
};
|
williamr@2
|
1553 |
|
williamr@2
|
1554 |
#include <es_sock.inl>
|
williamr@2
|
1555 |
|
williamr@2
|
1556 |
#endif //__ES_SOCK_H__
|