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 voidCancelRecv()
IMPORT_C voidCancelSend()
IMPORT_C voidClose()
IMPORT_C voidFinalizeAndSend(TPfkeySendMsgBase &, TRequestStatus &)
IMPORT_C TIntOpen(RSocketServ &)
IMPORT_C voidReadRequest(TDes8 &, TRequestStatus &)
IMPORT_C voidSendRequest(const TDesC8 &, TRequestStatus &)
IMPORT_C voidSetOpt(TUint, TUint, const TDesC8 &)
Private Member Functions
RSADB(const RSADB &)
Private Attributes
RSocket iPfkeySocket
TBool iRegistered

Constructor & Destructor Documentation

RSADB()

IMPORT_CRSADB()

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 voidCancelRecv()

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

CancelSend()

IMPORT_C voidCancelSend()

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

Close()

IMPORT_C voidClose()

Closes the handle to the stack side SADB.

FinalizeAndSend(TPfkeySendMsgBase &, TRequestStatus &)

IMPORT_C voidFinalizeAndSend(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 & aMessageThe message to be sent.
TRequestStatus & aStatusOn completion, KErrNone if successful, otherwise one of the system wide error codes.

Open(RSocketServ &)

IMPORT_C TIntOpen(RSocketServ &aServer)

Opens the handle to stack side SADB.

Parameters

RSocketServ & aServerA socketserver session to use.

ReadRequest(TDes8 &, TRequestStatus &)

IMPORT_C voidReadRequest(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 & aMsgA descriptor where the message will be placed.
TRequestStatus & aStatusOn return, KErrNone if successful, otherwise another of the system-wide error codes.

SendRequest(const TDesC8 &, TRequestStatus &)

IMPORT_C voidSendRequest(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 & aMsgA descriptor containing the message to be sent.
TRequestStatus & aStatusOn completion, KErrNone if successful, otherwise one of the system wide error codes.

SetOpt(TUint, TUint, const TDesC8 &)

IMPORT_C voidSetOpt(TUintaLevel,
TUintaName,
const TDesC8 &aOption
)

Changes the ip address of an endpoint.

Parameters

TUint aLevelThe option level
TUint aNameThe option name
const TDesC8 & aOptionThe option argument

Member Data Documentation

RSocket iPfkeySocket

RSocket iPfkeySocket[private]

TBool iRegistered

TBool iRegistered[private]