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