RSADB Class Reference

class RSADB

A handle to the stack side Ipsec SADB. All communication to the SADB takes place through this socket. As this happens using a well defined interface, PfkeyV2, the client is supposed to be aware of the semantics of using pfkey.

This class has to be a singleton in a thread The implementation of this class is not thread safe.

Public Member Functions
RSADB ()
~RSADB ()
IMPORT_C void CancelRecv ()
IMPORT_C void CancelSend ()
IMPORT_C void Close ()
IMPORT_C void FinalizeAndSend ( TPfkeySendMsgBase &, TRequestStatus &)
IMPORT_C TInt Open ( RSocketServ &)
IMPORT_C void ReadRequest ( TDes8 &, TRequestStatus &)
IMPORT_C void SendRequest (const TDesC8 &, TRequestStatus &)
IMPORT_C void SetOpt ( TUint , TUint , const TDesC8 &)
Private Member Functions
RSADB (const RSADB &)
Private Attributes
RSocket iPfkeySocket
TBool iRegistered

Constructor & Destructor Documentation

RSADB()

IMPORT_C RSADB ( )

Main SABD class Default constructor.

RSADB(const RSADB &)

RSADB ( const RSADB & ) [private]

Parameters

const RSADB &

~RSADB()

IMPORT_C ~RSADB ( )

Default destructor, closes the handle to the stack side SADB if open.

Member Functions Documentation

CancelRecv()

IMPORT_C void CancelRecv ( )

Cancels an outstanding ReadRequest() operation. Calling this function will cause any outstanding read request operation to complete prematurely.

CancelSend()

IMPORT_C void CancelSend ( )

Cancels an outstanding Send() operation. Calling the function will cause any outstanding send operation to complete prematurely.

Close()

IMPORT_C void Close ( )

Closes the handle to the stack side SADB.

FinalizeAndSend(TPfkeySendMsgBase &, TRequestStatus &)

IMPORT_C void FinalizeAndSend ( TPfkeySendMsgBase & aMessage,
TRequestStatus & aStatus
)
Finalises the message passed then sends it to the stack side SADB.
capability
NetworkControl Only privileged apps can affect policies

Parameters

TPfkeySendMsgBase & aMessage The message to be sent.
TRequestStatus & aStatus On completion, KErrNone if successful, otherwise one of the system wide error codes.

Open(RSocketServ &)

IMPORT_C TInt Open ( RSocketServ & aServer )

Opens the handle to stack side SADB.

Parameters

RSocketServ & aServer A socketserver session to use.

ReadRequest(TDes8 &, TRequestStatus &)

IMPORT_C void ReadRequest ( TDes8 & aMsg,
TRequestStatus & aStatus
)

Receives message from the stack side SADB. ReadRequest() should only be used with an open handle to stack side SADB. There may only be one receive operation outstanding at any one time.

capability
NetworkControl Only privileged apps can affect policies

Parameters

TDes8 & aMsg A descriptor where the message will be placed.
TRequestStatus & aStatus On return, KErrNone if successful, otherwise another of the system-wide error codes.

SendRequest(const TDesC8 &, TRequestStatus &)

IMPORT_C void SendRequest ( const TDesC8 & aMsg,
TRequestStatus & aStatus
)
Sends a message to the stack side SADB. SendRequest() should only be used with an open handle to stack side SADB.
capability
NetworkControl Only privileged apps can affect policies.

Parameters

const TDesC8 & aMsg A descriptor containing the message to be sent.
TRequestStatus & aStatus On completion, KErrNone if successful, otherwise one of the system wide error codes.

SetOpt(TUint, TUint, const TDesC8 &)

IMPORT_C void SetOpt ( TUint aLevel,
TUint aName,
const TDesC8 & aOption
)

Changes the ip address of an endpoint.

Parameters

TUint aLevel The option level
TUint aName The option name
const TDesC8 & aOption The option argument

Member Data Documentation

RSocket iPfkeySocket

RSocket iPfkeySocket [private]

TBool iRegistered

TBool iRegistered [private]