CProviderInet6Base Class Reference

class CProviderInet6Base : public CServProviderBase

Inherits from

Public Member Functions
CProviderInet6Base(CProtocolInet6Base *)
~CProviderInet6Base()
voidActiveOpen()
voidActiveOpen(const TDesC8 &)
voidAutoBind()
voidBearer(const TDesC8 &)
voidCanSend()
voidCancelIoctl(TUint, TUint)
voidError(TInt, TUint)
TBool FatalState()
TInt GetOption(TUint, TUint, TDes8 &)
TBool HasNetworkServices()
voidInitL()
voidIoctl(TUint, TUint, TDes8 *)
voidLocalName(TSockAddr &)
voidNoBearer(const TDesC8 &)
voidNoSecurityChecker()
TInt PassiveOpen(TUint)
TInt PassiveOpen(TUint, const TDesC8 &)
voidProcess(RMBufChain &, CProtocolBase *)
voidRemName(TSockAddr &)
voidSaveIcmpError(TInt, TInt, const TInetAddr &, const TInetAddr &, const TInetAddr &)
TInt SecurityCheck(MProvdSecurityChecker *)
TInt SetLocalName(TSockAddr &)
TInt SetOption(TUint, TUint, const TDesC8 &)
TInt SetRemName(TSockAddr &)
voidShutdown(TCloseType, const TDesC8 &)
voidStart()
TUint Write(const TDesC8 &, TUint, TSockAddr *)
TInt Write(RMBufChain &, TUint, TSockAddr *)
Protected Member Functions
TInt CheckPolicy(const TSecurityPolicy &, const char *)
TInt DoWrite(RMBufSendPacket &, RMBufSendInfo &, TUint, TUint)
TInt GetOptionInt(const TDesC8 &, TInt &)
TInt SetOptionInt(TDes8 &, TInt)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CServProviderBase::CServProviderBase()
CServProviderBase::GetData(RMBufChain &,TUint,TUint,TSockAddr *)
CServProviderBase::GetData(TDes8 &,TUint,TSockAddr *)
CServProviderBase::JoinSubConnectionL(ESock::CSubConnectionProviderBase &)
CServProviderBase::LeaveSubConnection(ESock::CSubConnectionProviderBase &)
CServProviderBase::SetNotify(MSocketNotify *)
CServProviderBase::SetSockType(TUint)
CServProviderBase::Shutdown(TCloseType)
CServProviderBase::SockType()const
CServProviderBase::~CServProviderBase()
Inherited Enumerations
CServProviderBase:TCloseType
Protected Attributes
TUint iErrorMask
RFlowContext iFlow
TUint iHasNetworkServices
TUint iHeaderIncluded
TUint iInterfaceIndex
TSoInetLastErr iLastError
CProviderInet6Base *iNextSAP
CProtocolInet6Base *constiProtocol
TInt iProtocolId
TUint iRawMode
TUint iRouteIndex
MProvdSecurityChecker *iSecurityChecker
TUint iSynchSend
Private Attributes
TUint iIsUser
Inherited Attributes
CServProviderBase::iSocket

Constructor & Destructor Documentation

CProviderInet6Base(CProtocolInet6Base *)

CProviderInet6Base(CProtocolInet6Base *aProtocol)

Parameters

CProtocolInet6Base * aProtocol

~CProviderInet6Base()

~CProviderInet6Base()[virtual]

Member Functions Documentation

ActiveOpen()

voidActiveOpen()[virtual]

ActiveOpen(const TDesC8 &)

voidActiveOpen(const TDesC8 &aConnectionData)[virtual]

Initiates a connection operation - this means that it tells the protocol to attempt to connect to a peer. It is called by the socket server in response to a connect request from a client.

This version of the function has user data in the connection frame.

Only ever called on connection-oriented sockets. Such a socket should always have both the local address and the remote address specified before this function is called. If this is not the case then the protocol should panic.

When a connection has completed, the protocol should call ConnectComplete() on its TNotify. If an error occurs during connection the protocol should not call ConnectComplete() at all; instead it should call Error().

Parameters

const TDesC8 & aConnectionDataIf the protocol supports user specified connection data, then it will be held in this buffer.

AutoBind()

voidAutoBind()[inline, virtual]

Specifies that the protocol should choose a local address for the service access point itself.

Bearer(const TDesC8 &)

voidBearer(const TDesC8 &aConnectionInfo)[virtual]

Parameters

const TDesC8 & aConnectionInfo

CanSend()

voidCanSend()[virtual]

CancelIoctl(TUint, TUint)

voidCancelIoctl(TUintaLevel,
TUintaName
)[virtual]

Cancels an outstanding Ioctl call. You are guaranteed only to have one outstanding at once.

Parameters

TUint aLevelIOCTL level.
TUint aNameIOCTL name.

CheckPolicy(const TSecurityPolicy &, const char *)

TInt CheckPolicy(const TSecurityPolicy &aPolicy,
const char *aDiagnostic
)[protected, virtual]

Parameters

const TSecurityPolicy & aPolicy
const char * aDiagnostic

DoWrite(RMBufSendPacket &, RMBufSendInfo &, TUint, TUint)

TInt DoWrite(RMBufSendPacket &,
RMBufSendInfo &,
TUint,
TUint
)[protected, inline, virtual]

Complete write processing for a datagram protocol

The base class Write() implements a common processing for simple datagram socket. After this setup work, the Write() calls DoWrite.

The aOffset has following semantics:
  • aOffset == 0, normal datagram without header included (DoWrite needs to add upper layer header)

  • aOffset > 0, header included was present, and offset indicates upper layer header in packet).

RMBufSendPacket has been prepared from the parameters of the Write function and the information block is initialized as follows:

  • iSrcAddr Family() == 0, Port() == 0

  • iDstAddr Family() == 0, Port() == 0

  • iProtocol == aProtocol

  • iFlags == aOptions & (KIpHeaderIncluded | KIpDontFragment)

  • iLength == aPacket.Length()

  • iFlow == 0

If KIpHeaderIncluded is set, the following is true

  • iSrcAddr Family() == KAfInet6 and address is loaded from the IPv4 or IPv6 header

  • iDstAddr Family() == KAfInet6 and address is loaded from the IPv4 or IPv6 header

  • iProtocol == KProtocolInetIP or KProtocolInet6Ip, depending on IP version.

If aToAddr and KIpHeaderIncluded are both set, the aToAddr overrides whatever is stored in the destination address of the included header.

If aToAddr is defined, the scope and flow label (if present) are preserved in the iDstAddr.

The return value, 'err'
  • err == KErrNoRMBufs, a special error return that blocks the socket

  • err < 0, causes Error(err, MSocketNotify::EErrorSend) to be called for the socket.

  • err == 0, the aPacket is sent out

  • err > 0, blocks the socket (current packet is retried later)

Error(TInt, TUint)

voidError(TIntaError,
TUintaOperationMask = MSocketNotify::EErrorAllOperations
)[virtual]

Parameters

TInt aError
TUint aOperationMask = MSocketNotify::EErrorAllOperations

FatalState()

TBool FatalState()[inline]

GetOption(TUint, TUint, TDes8 &)

TInt GetOption(TUintlevel,
TUintname,
TDes8 &anOption
)const [virtual]

Gets some protocol specific option when called by the socket server on behalf of a client. A protocol may pass the request down a protocol stack (to protocols it is bound to) using the GetOption() function of CProtocolBase.

Parameters

TUint level
TUint name
TDes8 & anOptionOption data.

GetOptionInt(const TDesC8 &, TInt &)

TInt GetOptionInt(const TDesC8 &anOption,
TInt &aVal
)[protected, static]

Parameters

const TDesC8 & anOption
TInt & aVal

HasNetworkServices()

TBool HasNetworkServices()[inline]

InitL()

voidInitL()[virtual]

Ioctl(TUint, TUint, TDes8 *)

voidIoctl(TUintlevel,
TUintname,
TDes8 *anOption
)[virtual]

Performs some protocol specific IO control.

Note:

If this function is called erroneously, the protocol should call Error() on the socket. If an Ioctl call is already outstanding, the client will be panicked with the value ETwoIoctls.

Parameters

TUint level
TUint name
TDes8 * anOptionOption data.

LocalName(TSockAddr &)

voidLocalName(TSockAddr &anAddr)const [inline, virtual]

Gets the local name (address) of the socket service provider entity. The format of the data in the TSockAddr object is defined by individual protocols.

The local address is the address of the local machine plus a local port number. Generally only the port number is important, unless you have two IP interfaces, for example.

Parameters

TSockAddr & anAddrThe address to be filled in

NoBearer(const TDesC8 &)

voidNoBearer(const TDesC8 &aConnectionParams)[virtual]

Parameters

const TDesC8 & aConnectionParams

NoSecurityChecker()

voidNoSecurityChecker()[inline]

PassiveOpen(TUint)

TInt PassiveOpen(TUintaQueSize)[virtual]

Tells the protocol to start waiting for an incoming connection request on this socket (i.e. port). It is called by the socket server in response to a listen request from a client.

Only ever called on connection-oriented sockets. Such a socket should always have both the local address and the remote address specified before this function is called. If this is not the case, then the protocol should panic.

The aQue parameter is the number of sockets which can be waiting for an outstanding Start after calling ConnectComplete(). The protocol should keep a count of sockets in this state - incrementing a variable in ConnectComplete(), and decrementing it in Start().

When a connection has completed, the protocol should call ConnectComplete() on its TNotify. If an error occurs during connection the protocol should not call ConnectComplete() at all; instead it should call Error().

Parameters

TUint aQueSizeSize of connect queue.

PassiveOpen(TUint, const TDesC8 &)

TInt PassiveOpen(TUintaQueSize,
const TDesC8 &aConnectionData
)[virtual]

Tells the protocol to start waiting for an incoming connection request on this socket (i.e. port). It is called by the socket server in response to a listen request from a client.

This version of the function has user data in the connection frame.

Only ever called on connection-oriented sockets. Such a socket should always have both the local address and the remote address specified before this function is called. If this is not the case then the protocol should panic.

The aQue parameter is the number of sockets which can be waiting for an outstanding Start after calling ConnectComplete(). The protocol should keep a count of sockets in this state - incrementing a variable in ConnectComplete(), and decrementing it in Start().

When a connection has completed the protocol should call ConnectComplete() on its TNotify. If an error occurs during connection the protocol should not call ConnectComplete() at all; instead it should call Error().

Parameters

TUint aQueSizesize of connect queue
const TDesC8 & aConnectionDataif the protocol supports user specified connection data then it will be held in this buffer.

Process(RMBufChain &, CProtocolBase *)

voidProcess(RMBufChain &aPacket,
CProtocolBase *aSourceProtocol = NULL
)[virtual]

Parameters

RMBufChain & aPacket
CProtocolBase * aSourceProtocol = NULL

RemName(TSockAddr &)

voidRemName(TSockAddr &anAddr)const [inline, virtual]

Gets the remote name (address) of the socket service provider entity. The format of the data in the TSockAddr object is defined by individual protocols.

A remote address is either the address you're sending data to (non connection-oriented sockets)* or the remote end of the connection. It is the address of the remote machine (your peer in the network) plus a port number.

Note:

RemName is only meaningful if the socket server client has called Connect() to set up a default address for SendTo(). This function will only be called on the protocol if this is the case.

Parameters

TSockAddr & anAddrThe address to be filled in

SaveIcmpError(TInt, TInt, const TInetAddr &, const TInetAddr &, const TInetAddr &)

voidSaveIcmpError(TIntaType,
TIntaCode,
const TInetAddr &aSrcAddr,
const TInetAddr &aDstAddr,
const TInetAddr &aErrAddr
)[virtual]

Parameters

TInt aType
TInt aCode
const TInetAddr & aSrcAddr
const TInetAddr & aDstAddr
const TInetAddr & aErrAddr

SecurityCheck(MProvdSecurityChecker *)

TInt SecurityCheck(MProvdSecurityChecker *aSecurityChecker)[virtual]

Use the class instance argument to perform security policy checks on the originating client process.

This method is called when a SAP is created and when a socket is transferred between sessions. The SAP is required to check whether the originating client process has enough privileges to request services from the SAP. The MProvdSecurityChecker class instance is used to perform security policy checks. The SAP may choose to perform a security policy check in its SecurityCheck(...) method, or it may choose to store the MProvdSecurityChecker class instance argument and perform checking later (i.e. when subsequent SAP methods are called).

Parameters

MProvdSecurityChecker * aSecurityCheckerPointer to class used by SAP to perform security checks on the client process. This pointer becomes invalid when the SAP is destroyed or detached.

SetLocalName(TSockAddr &)

TInt SetLocalName(TSockAddr &anAddr)[inline, virtual]

Sets the local name (address) of the socket service provider entity. The format of the data in the TSockAddr object is defined by individual protocols.

Parameters

TSockAddr & anAddrThe address

SetOption(TUint, TUint, const TDesC8 &)

TInt SetOption(TUintlevel,
TUintname,
const TDesC8 &anOption
)[virtual]

Sets some protocol specific option when called by the socket server on behalf of a client. A protocol may pass the request down a protocol stack (to protocols it is bound to) using the SetOption() function of CProtocolBase.

Parameters

TUint level
TUint name
const TDesC8 & anOptionOption data.

SetOptionInt(TDes8 &, TInt)

TInt SetOptionInt(TDes8 &anOption,
TIntaVal
)[protected, static]

Parameters

TDes8 & anOption
TInt aVal

SetRemName(TSockAddr &)

TInt SetRemName(TSockAddr &anAddr)[inline, virtual]

Sets the remote name (address) of the socket service provider entity. The format of the data in the TSockAddr object is defined by individual protocols.

Parameters

TSockAddr & anAddrThe address

Shutdown(TCloseType, const TDesC8 &)

voidShutdown(TCloseTypeoption,
const TDesC8 &aDisconnectionData
)[virtual]

Terminates a connection (or closes a non connection-oriented socket down).

The value of the option argument specifies the type of processing which will be required of the protocol after this function is called.

Normally, when the socket server has called Shutdown() for a socket, it will wait for the socket to call CanClose() before destroying the CServProviderBase object. However, if the option argument is EImmediate, the CServProviderBase will be destroyed as soon as Shutdown() returns.

Parameters

TCloseType optionThe shutdown type.
const TDesC8 & aDisconnectionDataIf the protocol supports disconnect data, any such data required will be held in this buffer.

Start()

voidStart()[virtual]

pure virtual Start a service provider.

Write(const TDesC8 &, TUint, TSockAddr *)

TUint Write(const TDesC8 &aDesc,
TUintoptions,
TSockAddr *anAddr = NULL
)[virtual]

Sends data onto the network via the protocol.

Connection-oriented sockets must be in a connected state (that is ConnectComplete() has been called on their MSocketNotify before Write() is called).

The socket server keeps track of how much data is waiting and then tries to send it all until the protocol tells it to hold off by returning 0 (datagram sockets) or 'less than all data consumed' (stream sockets) to Write(). The protocol should call CanSend() when it is ready to send more data.

anAddr is the address to write the data to. Connection oriented sockets always use the default value.

Parameters

const TDesC8 & aDescThe data to be sent.
TUint options
TSockAddr * anAddr = NULLAddress to write the data to.

Write(RMBufChain &, TUint, TSockAddr *)

TInt Write(RMBufChain &aData,
TUintaOptions,
TSockAddr *anAddr = NULL
)[virtual]

Sends data onto the network via the protocol.

Connection-oriented sockets must be in a connected state (that is ConnectComplete() has been called on their MSocketNotify before Write() is called).

The socket server keeps track of how much data is waiting and then tries to send it all until the protocol tells it to hold off by returning 0 (datagram sockets) or 'less than all data consumed' (stream sockets) to Write(). The protocol should call CanSend() when it is ready to send more data.

anAddr is the address to write the data to. Connection oriented sockets always use the default value.

Parameters

RMBufChain & aDataThe data to be sent.
TUint aOptionsProtocol specific options.
TSockAddr * anAddr = NULLAddress to write the data to.

Member Data Documentation

TUint iErrorMask

TUint iErrorMask[protected]

RFlowContext iFlow

RFlowContext iFlow[protected]

TUint iHasNetworkServices

TUint iHasNetworkServices[protected]

TUint iHeaderIncluded

TUint iHeaderIncluded[protected]

TUint iInterfaceIndex

TUint iInterfaceIndex[protected]

TUint iIsUser

TUint iIsUser[private]

TSoInetLastErr iLastError

TSoInetLastErr iLastError[protected]

CProviderInet6Base * iNextSAP

CProviderInet6Base *iNextSAP[protected]

CProtocolInet6Base *const iProtocol

CProtocolInet6Base *constiProtocol[protected]

TInt iProtocolId

TInt iProtocolId[protected]

TUint iRawMode

TUint iRawMode[protected]

TUint iRouteIndex

TUint iRouteIndex[protected]

MProvdSecurityChecker * iSecurityChecker

MProvdSecurityChecker *iSecurityChecker[protected]

TUint iSynchSend

TUint iSynchSend[protected]