epoc32/include/wsp/wsptypes.h
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- a/epoc32/include/wsp/wsptypes.h	Tue Mar 16 16:12:26 2010 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,535 +0,0 @@
     1.4 -// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 -// All rights reserved.
     1.6 -// This component and the accompanying materials are made available
     1.7 -// 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
     1.8 -// which accompanies this distribution, and is available
     1.9 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.10 -//
    1.11 -// Initial Contributors:
    1.12 -// Nokia Corporation - initial contribution.
    1.13 -//
    1.14 -// Contributors:
    1.15 -//
    1.16 -// Description:
    1.17 -//
    1.18 -
    1.19 -
    1.20 -
    1.21 -/**
    1.22 - @file WspTypes.h
    1.23 - @warning : This file contains Rose Model ID comments - please do not delete
    1.24 -*/
    1.25 -
    1.26 -#ifndef __WSPTYPES_H__
    1.27 -#define __WSPTYPES_H__
    1.28 -
    1.29 -// System includes
    1.30 -#include <e32base.h>
    1.31 -#include <stringpool.h>
    1.32 -
    1.33 -//TODO - These will move to a common WAPMSG/WSPTransport file at a later stage,
    1.34 -//in the wap-stack subsystem, to be shared with the WAP Messaging API.
    1.35 -
    1.36 -namespace Wap
    1.37 -/**
    1.38 -All type definitions and enumerations used in WSP are in placed in a wider WAP
    1.39 -namespace, to avoid name conflicts with other components.
    1.40 -@publishedAll
    1.41 -@released
    1.42 -*/
    1.43 -{
    1.44 -
    1.45 -/** The TWspPrimitive type represents the WSP primitives defined in the WSP
    1.46 -	Specification, July 2001.
    1.47 -*/
    1.48 -enum TWspPrimitive
    1.49 -	{
    1.50 -	/**
    1.51 -	*/
    1.52 -	ESConnect			= 0,
    1.53 -	/**
    1.54 -	*/
    1.55 -	ESDisconnect,
    1.56 -	/**
    1.57 -	*/
    1.58 -	ESSuspend,
    1.59 -	/**
    1.60 -	*/
    1.61 -	ESResume,
    1.62 -	/**
    1.63 -	*/
    1.64 -	ESException,
    1.65 -	/**
    1.66 -	*/
    1.67 -	ESMethodInvoke,
    1.68 -	/**
    1.69 -	*/
    1.70 -	ESMethodInvokeData,
    1.71 -	/**
    1.72 -	*/
    1.73 -	ESMethodResult,
    1.74 -	/**
    1.75 -	*/
    1.76 -	ESMethodResultData,
    1.77 -	/**
    1.78 -	*/
    1.79 -	ESMethodAbort,
    1.80 -	/**
    1.81 -	*/
    1.82 -	ESPush,
    1.83 -	/**
    1.84 -	*/
    1.85 -	ESConfirmedPush,
    1.86 -	/**
    1.87 -	*/
    1.88 -	ESPushAbort
    1.89 -	};
    1.90 -
    1.91 -/** The TWspProtocolOptions type represents the optional protocol functions 
    1.92 -	defined in the WSP Specification, July 2001. When the client sends the 
    1.93 -	Protocol Capability to the server, it indicates which functions it will
    1.94 -	accept from the server. The server returns from the set of functions sent
    1.95 -	by the client those that it will perform.
    1.96 -*/
    1.97 -enum TWspProtocolOptions
    1.98 -	{
    1.99 -	/** The Large Data Transfer feature includes support for multiple SDU's and
   1.100 -		support for the Data Fragment PDU. Setting this falg indicates support 
   1.101 -		for sending and receiving large data. If a client only wishes to receive
   1.102 -		large data, then it should set the Client and Server Message size fields
   1.103 -		appropriately.
   1.104 -	*/
   1.105 -	ELargeDataTransfer			= 0x08,
   1.106 -	/** The acknowledgement headers flag specifies that the client wishes to send
   1.107 -		acknowledgement headers. If the server cannot process them (indicated by
   1.108 -		negotiating down the flag) the client should not send the headers as they
   1.109 -		will be ignored.
   1.110 -	*/
   1.111 -	EAcknowledgementHeaders		= 0x10,
   1.112 -	/** The client enables the Suspend Resume facility when it wishes to suspend
   1.113 -		and resume the session. If the server does not support suspend and resume
   1.114 -		then this flag must be cleared in the negotiated capabilities.
   1.115 -	*/
   1.116 -	ESessionResumeFacility		= 0x20,
   1.117 -	/** The client uses this flag to indicate that it is able and willing to 
   1.118 -		receive push information. If the server cannot send pushes then this flag 
   1.119 -		must be cleared in the negotiated capabilities.
   1.120 -	*/
   1.121 -	EPushFacility				= 0x40,
   1.122 -	/** The client uses this flag to indicate that it is able and willing to 
   1.123 -		receive confirmed push information. If the server cannot send pushes 
   1.124 -		then this flag must be cleared in the negotiated capabilities.
   1.125 -	*/
   1.126 -	EConfirmedPushFacility		= 0x80
   1.127 -	};
   1.128 -
   1.129 -/** The TWspSessionState type represents the states of a WSP session, as defined
   1.130 -	by the WSP Specification, July 2001.
   1.131 -*/
   1.132 -enum TWspSessionState
   1.133 -	{
   1.134 -	/** 
   1.135 -	*/
   1.136 -	ENull			= 0,
   1.137 -	/**
   1.138 -	*/
   1.139 -	EConnecting,
   1.140 -	/**
   1.141 -	*/
   1.142 -	EConnected,
   1.143 -	/**
   1.144 -	*/
   1.145 -	ESuspending,
   1.146 -	/**
   1.147 -	*/
   1.148 -	ESuspended,
   1.149 -	/**
   1.150 -	*/
   1.151 -	EClosing,
   1.152 -	/**
   1.153 -	*/
   1.154 -	EResuming
   1.155 -	};
   1.156 -
   1.157 -/** The TWspMethodState type represents the states of a WSP method transaction,
   1.158 -	as defined by the WSP Specification, July 2001.
   1.159 -*/
   1.160 -enum TWspMethodState
   1.161 -	{
   1.162 -	/**
   1.163 -	*/
   1.164 -	ENullMethod			=0,
   1.165 -	/**
   1.166 -	*/
   1.167 -	ERequesting,
   1.168 -	/**
   1.169 -	*/
   1.170 -	EWaiting,
   1.171 -	/**
   1.172 -	*/
   1.173 -	EWaiting2,
   1.174 -	/**
   1.175 -	*/
   1.176 -	ECompleting,
   1.177 -	/**
   1.178 -	*/
   1.179 -	EAborting
   1.180 -	};
   1.181 -
   1.182 -/** The TWspBearer type defines the set of supported bearers.
   1.183 -*/
   1.184 -enum TWspBearer
   1.185 -	{
   1.186 -	/** Specifier for any bearer.
   1.187 -	*/
   1.188 -	EAny		= 0,
   1.189 -	/** IP bearer.
   1.190 -	*/
   1.191 -	EIP,
   1.192 -	/** A 7-bit SMS bearer.
   1.193 -	*/
   1.194 -	ESMS7,
   1.195 -	/** An 8-bit SMS bearer.
   1.196 -	*/
   1.197 -	ESMS,
   1.198 -	/** A 7-bit WAP SMS bearer.
   1.199 -	*/
   1.200 -	EWAPSMS7,
   1.201 -	/** An 8-bit WAP SMS bearer.
   1.202 -	*/
   1.203 -	EWAPSMS
   1.204 -	};
   1.205 -
   1.206 -/** The TWspSession type defines the 2 types of WSP Session Service; Connection
   1.207 -	Oriented and Connectionless.
   1.208 -*/
   1.209 -enum TWspSession
   1.210 -	{
   1.211 -	/** Specifier for Connection Oriented Session Service.
   1.212 -	*/
   1.213 -	EWspConnectionOriented			= 0,
   1.214 -	/** Specifier for Connectionless Session Service.
   1.215 -	*/
   1.216 -	EWspConnectionLess
   1.217 -	};
   1.218 -
   1.219 -/** The TWspReason type is used by to report the cause of a particular indication 
   1.220 -	primitive. The WSP Specification, July 2001, specifies a given set that MUST
   1.221 -	be recognised (6.2.5). Further values may be added.
   1.222 -*/
   1.223 -enum TWspReason
   1.224 -	{
   1.225 -	/** The rules of the protocol were broken and in its current state, the peer
   1.226 -		could not perform the specified operation. E.g. the PDU was not allowed.
   1.227 -	*/
   1.228 -	EProtoErr			= 0xE0,
   1.229 -	/** The session was disconnected while the operation was still in progress.
   1.230 -	*/
   1.231 -	EDisconnect			= 0xE1,
   1.232 -	/** The session was suspended while the operation was still in progress.
   1.233 -	*/
   1.234 -	ESuspend			= 0xE2,
   1.235 -	/** The session was resumed while the operation was still in progress.
   1.236 -	*/
   1.237 -	EResume				= 0xE3,
   1.238 -	/** The request could not be processed due to a lack of resources.
   1.239 -	*/
   1.240 -	ECongestion			= 0xE4,
   1.241 -	/** The connection was prevented due to an error.
   1.242 -	*/ 
   1.243 -	EConnectErr			= 0xE5,
   1.244 -	/** The SDU size in a request exceeded the maximum negotiated SDU size.
   1.245 -	*/
   1.246 -	EMRUExceeded		= 0xE6,
   1.247 -	/** The negotiated value of the maximum outstanding transactions (either for
   1.248 -		push or method transactions) has been exceeded.
   1.249 -	*/
   1.250 -	EMORExceeded		= 0xE7,
   1.251 -	/** The operation was aborted by the Provider. 
   1.252 -	*/
   1.253 -	EPeerReq			= 0xE8,
   1.254 -	/** An underlying network error prevented the completion of a request.
   1.255 -	*/
   1.256 -	ENetErr				= 0xE9,
   1.257 -	/** The cause of the indication was an action by the Client.
   1.258 -	*/
   1.259 -	EUserReq			= 0xEA,
   1.260 -	/** The client has refesed the Push message, no specific reason, no retries.
   1.261 -	*/
   1.262 -	EUserRfs			= 0xEB,
   1.263 -	/** The Push message cannot be delivered to the intended destination.
   1.264 -	*/
   1.265 -	EUserPnd			= 0xEC,
   1.266 -	/** The Push message was discarded due to resource shortage.
   1.267 -	*/
   1.268 -	EUserDcr			= 0xED,
   1.269 -	/** The content-type of the Push message cannot be processed.
   1.270 -	*/
   1.271 -	EUserDcu			= 0xEE,
   1.272 -	/** The session connect request has been redirected to a new proxy. This is
   1.273 -		a temporary redirection and the original proxy should be used in the
   1.274 -		future when trying to access this service. This is not defined by the 
   1.275 -		WSP Specification.
   1.276 -	*/
   1.277 -	ETemporaryRedirectedProxy	=0,
   1.278 -	/** The session connect request has been redirected to a new proxy. This is
   1.279 -		a permanent redirection and the new proxy should be used in the future 
   1.280 -		when trying to access this service. The client will be notified of this
   1.281 -		event and the HTTP session property EWspProxyAddressnew will contain the
   1.282 -		new proxy's address. The client should update its access point database.
   1.283 -		This is not defined by the WSP Specification.
   1.284 -	*/
   1.285 -	EPermanentRedirectedProxy,
   1.286 -	/** The client had disconnected the session, but as Suspend Resume facility
   1.287 -		was being used, the session was suspended. The client then changed the
   1.288 -		proxy and did a connect. The suspended session cannot be resumed, so the
   1.289 -		the current session must be disconnected (with this reason) and a 
   1.290 -		session connect initiated with the new proxy. This is not defined by the
   1.291 -		WSP Specification.
   1.292 -	*/
   1.293 -	EChangedProxyInSuspendedSession,
   1.294 -	/** The client's WSP session was disconnected in the Connecting state because
   1.295 -		configuration of the underlying WTLS layer failed prior to the phase 1
   1.296 -		WTLS handshake.
   1.297 -	*/
   1.298 -	EWtlsConfigurationFailed,
   1.299 -	/** The client's WSP session was disconnected in the Connecting state because
   1.300 -		phase 1 of the WTLS handshake failed.
   1.301 -	*/
   1.302 -	EWtlsPhase1HandshakeFailed,
   1.303 -	/** The client's WSP session was disconnected in the Connecting state because
   1.304 -		phase 2 of the WTLS handshake failed.
   1.305 -	*/
   1.306 -	EWtlsPhase2HandshakeFailed,
   1.307 -	/** The client's WSP session was disconnected in the Connecting state because
   1.308 -		the proxy's WTLS certificate was invalid - e.g. badly formed, or out of date.
   1.309 -	*/
   1.310 -	EWtlsInvalidServerCert,
   1.311 -	/** The client's WSP session was disconnected in the Connecting state because
   1.312 -		the proxy's WTLS certificate could not be trusted.  This means it was not signed
   1.313 -		by any root certificate on the device, and the security policy criteria could not
   1.314 -		determine further whether it could be trusted or not.
   1.315 -	*/
   1.316 -	EWtlsUntrustedServerCert,
   1.317 -	/** The client's WSP session was disconnected in the Connecting state because
   1.318 -		the negotiated WTLS configuration at completion of the secure handshake was
   1.319 -		rejected by criteria in the security policy.
   1.320 -	*/
   1.321 -	EWtlsNegotiatedConfigRejected,
   1.322 -	/** The client's transaction or session has failed due to an out-of-memory situation.
   1.323 -	*/
   1.324 -	EOutOfMemory,
   1.325 -	/** The client's session has entered an inconsistent state, probably due to a failure caused
   1.326 -		by an out-of-memory situation.
   1.327 -	*/
   1.328 -	ESessionStateFailure
   1.329 -	};
   1.330 -
   1.331 -/**	The enum TWspCapabilty is used to select a capability to reset (if required) 
   1.332 -	before setting the value of the capability.
   1.333 -*/
   1.334 -enum TWspCapability
   1.335 -	{
   1.336 -	/** Specifies the Alias Addresses capability.
   1.337 -	*/
   1.338 -	EAliasAddresses				= 0,
   1.339 -	/** Specifies the Extended Methods capability.
   1.340 -	*/
   1.341 -	EExtendedMethods,
   1.342 -	/** Specifies the Header Code Pages capability.
   1.343 -	*/
   1.344 -	EHeaderCodePages,
   1.345 -	/** Specifies the Method Maximum Outstanding Requests capability. Default value is 1.
   1.346 -	*/
   1.347 -	EMethodMOR,
   1.348 -	/** Specifies the Push Maximum Outstanding Requests capability. Default value is 1.
   1.349 -	*/
   1.350 -	EPushMOR,
   1.351 -	/** Specifies the Protocol Options capability. Default value is 0x00.
   1.352 -	*/
   1.353 -	EProtocolOptions,
   1.354 -	/** Specifies the Client SDU size capability. Default value is 1400 octets.
   1.355 -	*/
   1.356 -	EClientSDUSize,
   1.357 -	/** Specifies the Server SDU size capability. Default value is 1400 octets.
   1.358 -	*/
   1.359 -	EServerSDUSize,
   1.360 -	/** Specifies the Client Message size capability. Default value is 1400 octets.
   1.361 -	*/
   1.362 -	EClientMessageSize,
   1.363 -	/** Specifies the Server Message size capability. Default value is 1400 octets.
   1.364 -	*/
   1.365 -	EServerMessageSize,
   1.366 -	/** Specifies the Unknown capabilities.
   1.367 -	*/
   1.368 -	EUnknownCapabilities,
   1.369 -	/** Specifies all the capabilities.
   1.370 -	*/
   1.371 -	EAllCapabilities
   1.372 -	};
   1.373 -
   1.374 -} // end of namespace Wap
   1.375 -
   1.376 -
   1.377 -/**
   1.378 -Maximum Proxy address length, this is large enough for a full IPv6 address.
   1.379 -@publishedAll
   1.380 -@released
   1.381 -*/
   1.382 -const TInt KMaxProxyAddrLen = 40;
   1.383 -
   1.384 -//##ModelId=3C4C41B20079
   1.385 -class TWspRedirectedAddress
   1.386 -/**	
   1.387 -The TWspRedirectedAddress type represents an alternate address to which 
   1.388 -Clients must use to establish a session with the same service that was 
   1.389 -initially contacted. If the bearer or port fields have been excluded, then
   1.390 -the orginal bearer and port should be used to contact the new server. The 
   1.391 -WSP Specification, July 2001, defines an Address Type (8.2.2.3) upon which 
   1.392 -this class is based.
   1.393 -@publishedAll
   1.394 -@released
   1.395 -*/
   1.396 -	{
   1.397 -public:	// Attributes
   1.398 -
   1.399 -	/** A flag to indicate that the port field is set.
   1.400 -	*/
   1.401 -	//##ModelId=3C4C41B200DD
   1.402 -	TBool		iHasPort;
   1.403 -
   1.404 -	/** A flag to indicate that the bearer field is set.
   1.405 -	*/
   1.406 -	//##ModelId=3C4C41B200CB
   1.407 -	TBool		iHasBearer;
   1.408 -
   1.409 -	/** The proxy address.
   1.410 -	*/
   1.411 -	//##ModelId=3C4C41B200C1
   1.412 -	TBuf8<KMaxProxyAddrLen>	iProxyAddress;
   1.413 -
   1.414 -	/** The port number. 
   1.415 -	*/
   1.416 -	//##ModelId=3C4C41B200B5
   1.417 -	TUint16		iPort;
   1.418 -
   1.419 -	/** The bearer type.
   1.420 -	*/
   1.421 -	//##ModelId=3C4C41B200A3
   1.422 -	Wap::TWspBearer	iBearer;
   1.423 -	};
   1.424 -
   1.425 -/**
   1.426 -Maximum length of a key ID for WTLS
   1.427 -@publishedAll
   1.428 -@released
   1.429 -*/
   1.430 -const TInt KWtlsMaxKeyIdLength = 512;
   1.431 -
   1.432 -class TWtlsKeyExchangeSuite
   1.433 -/**
   1.434 -The class TWtlsKeyExchangeSuite contain the definitions of WTLS
   1.435 -Key Exchange Suites as defined in the WAP WTLS Specification, July 2001
   1.436 -@publishedAll
   1.437 -@released 
   1.438 -*/
   1.439 -	{
   1.440 -public:
   1.441 -	enum TKeyExchangeSuite
   1.442 -		{
   1.443 -		ENULL					=0,
   1.444 -		ESHARED_SECRET			=1,
   1.445 -		EDH_anon				=2,
   1.446 -		EDH_anon_512			=3,
   1.447 -		EDH_anon_768			=4,
   1.448 -		ERSA_anon				=5,
   1.449 -		ERSA_anon_512			=6,
   1.450 -		ERSA_anon_768			=7,
   1.451 -		ERSA					=8,
   1.452 -		ERSA_512				=9,
   1.453 -		ERSA_768				=10,
   1.454 -		EECDH_anon				=11,
   1.455 -		EECDH_anon_113			=12,
   1.456 -		EECDH_anon_131			=13,
   1.457 -		EECDH_ECDSA				=14,
   1.458 -		EECDH_anon_uncomp		=15,
   1.459 -		EECDH_anon_uncomp_113	=16,
   1.460 -		EECDH_anon_uncomp_131	=17,
   1.461 -		EECDH_ECDSA_uncomp		=18
   1.462 -		};
   1.463 -	enum TKeyIdType 
   1.464 -		{
   1.465 -		EIdNull			= 0,
   1.466 -		EText			= 1, 
   1.467 -		EBinary			= 2, 
   1.468 -		EKeyHashSha		= 254, 
   1.469 -		EX509Name		= 255
   1.470 -		};
   1.471 -
   1.472 -public:
   1.473 -	TWtlsKeyExchangeSuite(TKeyExchangeSuite aKeyExchangeSuite, TKeyIdType aKeyIdType, const TBuf8<KWtlsMaxKeyIdLength>& aKeyId);
   1.474 -
   1.475 -public:
   1.476 -	TKeyExchangeSuite iKeyExchangeSuite;
   1.477 -	TKeyIdType iKeyIdType;
   1.478 -	TBuf8<KWtlsMaxKeyIdLength> iKeyId;
   1.479 -	};
   1.480 -
   1.481 -class TWtlsCipherSuite
   1.482 -/**
   1.483 -The class TWtlsCipherSuite encapsulates a WTLS cipher suite as defined in
   1.484 -the WAP WTLS Specification, July 2001
   1.485 -This is a pair made up of a Bulk Encryption Algorithm and a Mac Algorithm
   1.486 -@publishedAll
   1.487 -@released
   1.488 -*/
   1.489 -	{
   1.490 -public:
   1.491 -			
   1.492 -	enum TBulkEncryptionAlgorithm
   1.493 -		{
   1.494 -		ENULL			=0,
   1.495 -		ERC5_CBC_40		=1,
   1.496 -		ERC5_CBC_56		=2,
   1.497 -		ERC5_CBC		=3,
   1.498 -		EDES_CBC_40		=4,
   1.499 -		EDES_CBC		=5,
   1.500 -		E3DES_CBC_EDE	=6,
   1.501 -		EIDEA_CBC_40	=7,
   1.502 -		EIDEA_CBC_56	=8,
   1.503 -		EIDEA_CBC		=9,
   1.504 -		ERC5_CBC_64		=10,
   1.505 -		EIDEA_CBC_64	=11
   1.506 -		};
   1.507 -
   1.508 -	enum TMacAlgorithm
   1.509 -		{
   1.510 -		ESHA_0			=0,
   1.511 -		ESHA_40			=1,
   1.512 -		ESHA_80			=2,
   1.513 -		ESHA			=3,
   1.514 -//		N/A (removed)	=4,
   1.515 -		EMD5_40			=5,
   1.516 -		EMD5_80			=6,
   1.517 -		EMD5			=7,
   1.518 -		};
   1.519 -
   1.520 -	TWtlsCipherSuite(TBulkEncryptionAlgorithm aBulkEncryptionAlgorithm, TMacAlgorithm aMacAlgorithm);
   1.521 -
   1.522 -public:
   1.523 -	TBulkEncryptionAlgorithm iBulkEncryptionAlgorithm;
   1.524 -	TMacAlgorithm iMacAlgorithm;
   1.525 -	};
   1.526 -
   1.527 -inline TWtlsCipherSuite::TWtlsCipherSuite(TBulkEncryptionAlgorithm aBulkEncryptionAlgorithm, TMacAlgorithm aMacAlgorithm)
   1.528 -	: iBulkEncryptionAlgorithm(aBulkEncryptionAlgorithm), iMacAlgorithm(aMacAlgorithm)
   1.529 -	{
   1.530 -	}
   1.531 -
   1.532 -inline TWtlsKeyExchangeSuite::TWtlsKeyExchangeSuite(TKeyExchangeSuite aKeyExchangeSuite, TKeyIdType aKeyIdType, const TBuf8<KWtlsMaxKeyIdLength>& aKeyId)
   1.533 -	: iKeyExchangeSuite(aKeyExchangeSuite), iKeyIdType(aKeyIdType), iKeyId(aKeyId)
   1.534 -	{
   1.535 -	}
   1.536 -
   1.537 -
   1.538 -#endif	// __WSPTYPES_H__