CSRTPSession Class Reference

class CSRTPSession : public CBase

Contains an SRTP session

Inherits from

Public Member Functions
~CSRTPSession()
voidAddStreamToList(CSRTPStream *)
CSRTPCryptoContext &GetCryptoContext()
IMPORT_C CSRTPSession *NewL(const TInetAddr &)
IMPORT_C CSRTPSession *NewL(const TInetAddr &, CSRTPCryptoContext *, MSRTPReKeyingObserver &)
IMPORT_C CSRTPSession *NewLC(const TInetAddr &)
IMPORT_C CSRTPSession *NewLC(const TInetAddr &, CSRTPCryptoContext *, MSRTPReKeyingObserver &)
IMPORT_C HBufC8 *ProtectRTCPL(TUint, const TDesC8 &)
IMPORT_C HBufC8 *ProtectRTPL(TUint, const TDesC8 &)
voidReKeyNeeded(const CSRTPStream &, TBool)
IMPORT_C const TInetAddr &RemoteAddr()
voidRemoveStreamFromList(CSRTPStream *)
IMPORT_C voidSetCryptoContextL(CSRTPCryptoContext *)
IMPORT_C CSRTPStream &StreamL(TUint, TBool)
IMPORT_C HBufC8 *UnprotectRTCPL(TUint, const TDesC8 &)
IMPORT_C HBufC8 *UnprotectRTPL(TUint, const TDesC8 &)
Private Member Functions
CSRTPSession(const TInetAddr &, MSRTPReKeyingObserver &)
CSRTPSession(const TInetAddr &)
voidConstructL(CSRTPCryptoContext *)
HBufC8 *FindLateBindingStreamAndUnprotectRTCPL(TUint, const TDesC8 &)
HBufC8 *FindLateBindingStreamAndUnprotectRTPL(TUint, const TDesC8 &)
TBool FindStream(TUint, TBool)
voidRemoveAllStream()
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()
Protected Attributes
TBool iRekey
TBool iSesssionCrypto
Private Attributes
CSRTPCryptoContext *iContext
const TInetAddr &iDestination
MSRTPReKeyingObserver *iObserver
TUint8 iStreamCount
TSglQueIter< CSRTPStream >iStreamIter
TSglQueLink iStreamLink
TSglQue< CSRTPStream >iStreamList

Constructor & Destructor Documentation

CSRTPSession(const TInetAddr &, MSRTPReKeyingObserver &)

CSRTPSession(const TInetAddr &aDestination,
MSRTPReKeyingObserver &aObs
)[private]

Parameters

const TInetAddr & aDestination
MSRTPReKeyingObserver & aObs

CSRTPSession(const TInetAddr &)

CSRTPSession(const TInetAddr &aDestination)[private]

Parameters

const TInetAddr & aDestination

~CSRTPSession()

~CSRTPSession()

Destructor, remove and delete all the stream in the session

Member Functions Documentation

AddStreamToList(CSRTPStream *)

voidAddStreamToList(CSRTPStream *aStream)

Add given stream to the list of CSRTPStream objects

Parameters

CSRTPStream * aStreamThe stream to be added to list

ConstructL(CSRTPCryptoContext *)

voidConstructL(CSRTPCryptoContext *aCon)[private]

Parameters

CSRTPCryptoContext * aCon

FindLateBindingStreamAndUnprotectRTCPL(TUint, const TDesC8 &)

HBufC8 *FindLateBindingStreamAndUnprotectRTCPL(TUintaSSRC,
const TDesC8 &aPacket
)[private]

Parameters

TUint aSSRC
const TDesC8 & aPacket

FindLateBindingStreamAndUnprotectRTPL(TUint, const TDesC8 &)

HBufC8 *FindLateBindingStreamAndUnprotectRTPL(TUintaSSRC,
const TDesC8 &aPacket
)[private]

Parameters

TUint aSSRC
const TDesC8 & aPacket

FindStream(TUint, TBool)

TBool FindStream(TUintaSSRC,
TBoolaIsInStream
)[private]

Parameters

TUint aSSRC
TBool aIsInStream

GetCryptoContext()

CSRTPCryptoContext &GetCryptoContext()

Get cryptographic context associated for this session

NewL(const TInetAddr &)

IMPORT_C CSRTPSession *NewL(const TInetAddr &aDestination)[static]
Two-phased constructor. Use this function if each stream will have its own cryptographic context.
leave
KErrNone if success, system-wide error code otherwise

Parameters

const TInetAddr & aDestinationThe destination address, including the port.

NewL(const TInetAddr &, CSRTPCryptoContext *, MSRTPReKeyingObserver &)

IMPORT_C CSRTPSession *NewL(const TInetAddr &aDestination,
CSRTPCryptoContext *aCon,
MSRTPReKeyingObserver &aObs
)[static]
Two-phased constructor. Use this function if all streams will use the same cryptographic context.
leave
KErrNone if success, system-wide error code otherwise

Parameters

const TInetAddr & aDestinationThe destination address, including the port
CSRTPCryptoContext * aConThe default cryptographic context for the session, ownership is transferred.
MSRTPReKeyingObserver & aObsThe callback object

NewLC(const TInetAddr &)

IMPORT_C CSRTPSession *NewLC(const TInetAddr &aDestination)[static]
Two-phased constructor. Creates a new CSRTPSession instance and pushes it to CleanupStack. Use this function if each stream will have its own cryptographic context.
leave
KErrNone if success, system-wide error code otherwise

Parameters

const TInetAddr & aDestinationThe destination address, including the port.

NewLC(const TInetAddr &, CSRTPCryptoContext *, MSRTPReKeyingObserver &)

IMPORT_C CSRTPSession *NewLC(const TInetAddr &aDestination,
CSRTPCryptoContext *aCon,
MSRTPReKeyingObserver &aObs
)[static]
Two-phased constructor. Creates a new CSRTPSession instance and pushes it to CleanupStack. Use this function if all streams will use the same cryptographic context.
leave
KErrNone if success, system-wide error code otherwise

Parameters

const TInetAddr & aDestinationThe destination address, including the port
CSRTPCryptoContext * aConThe default cryptographic context for the session, ownership is transferred.
MSRTPReKeyingObserver & aObsThe callback object

ProtectRTCPL(TUint, const TDesC8 &)

IMPORT_C HBufC8 *ProtectRTCPL(TUintaSSRC,
const TDesC8 &aPacket
)

Session should find the match stream and protect packet Note that if there are no matching stream, the function leave

Parameters

TUint aSSRC- [input] SSRC of interest
const TDesC8 & aPacket- [input] packet to be protected, the length of descriptor should be the same with the actual data.

ProtectRTPL(TUint, const TDesC8 &)

IMPORT_C HBufC8 *ProtectRTPL(TUintaSSRC,
const TDesC8 &aPacket
)

Session should find the match stream and protect stream Note that if there are no matching stream, the function leave

Parameters

TUint aSSRC- [input] SSRC of interest
const TDesC8 & aPacket- [input] packet to be protected, the length of descriptor should be the same with the actual data, otherwise encoding will not be correct.

ReKeyNeeded(const CSRTPStream &, TBool)

voidReKeyNeeded(const CSRTPStream &aStream,
TBoolaIsStrmCrypto
)

Call for Rekey

Parameters

const CSRTPStream & aStreamthe stream which needs to be rekey
TBool aIsStrmCryptoTrue if stream has it's own crypto, false otherwise

RemoteAddr()

IMPORT_C const TInetAddr &RemoteAddr()

Return the destination address set in NewL

RemoveAllStream()

voidRemoveAllStream()[private]

RemoveStreamFromList(CSRTPStream *)

voidRemoveStreamFromList(CSRTPStream *aStream)

Remove given stream from the list of CSRTPStream objects

Parameters

CSRTPStream * aStreamThe stream to be removed

SetCryptoContextL(CSRTPCryptoContext *)

IMPORT_C voidSetCryptoContextL(CSRTPCryptoContext *aCon)
Set/Update crypto context sharing between streams Crypto context ownersh p is transfered. Note that to update crypto context, the states and the number of packets received will be reset. ROC will not be re-intialized. This can be used only when keys lifetime has not expired. RFC 4568 6.5, 6.4
leave
KErrNone if success, system-wide error code otherwise

Parameters

CSRTPCryptoContext * aCon

StreamL(TUint, TBool)

IMPORT_C CSRTPStream &StreamL(TUintaSSRC,
TBoolaIsInStream
)

Retrieve CSSRTPStream object associated with given SSRC. Note that if there are any duplicates the first one is returned. Otherwise, Multiple SRTP streams with identical SSRCs and with same stream type (In/Out stream) are not supported.

Parameters

TUint aSSRC- [input] SSRC of interest
TBool aIsInStream

UnprotectRTCPL(TUint, const TDesC8 &)

IMPORT_C HBufC8 *UnprotectRTCPL(TUintaSSRC,
const TDesC8 &aPacket
)

SRTPSession find the match stream and unprotect packet Note that if there are no matching stream, the function leaves SRTP must have been recive earlier otherwise the function will leave with KErrNotFound--no SSRC matching stream found Note that the streamIn must have to be created to receive RTCP report if there is only one streamOut.

Parameters

TUint aSSRC- [input] SSRC of interest
const TDesC8 & aPacket- [input] packet to be Unprotected

UnprotectRTPL(TUint, const TDesC8 &)

IMPORT_C HBufC8 *UnprotectRTPL(TUintaSSRC,
const TDesC8 &aPacket
)

SRTPSession find the match stream and unprotect stream Note that if there are no matching stream, the function leave In late binding cases, session will try to find the stream which SSRC is equal to zero and unprotect the packet. If the autenticate for the packet is successful, SSRC will be set to this stream.

Parameters

TUint aSSRC- [input] SSRC of interest
const TDesC8 & aPacket- [input] packet to be Unprotected

Member Data Documentation

CSRTPCryptoContext * iContext

CSRTPCryptoContext *iContext[private]

const TInetAddr & iDestination

const TInetAddr &iDestination[private]

MSRTPReKeyingObserver * iObserver

MSRTPReKeyingObserver *iObserver[private]

TBool iRekey

TBool iRekey[protected]

TBool iSesssionCrypto

TBool iSesssionCrypto[protected]

TUint8 iStreamCount

TUint8 iStreamCount[private]

TSglQueIter< CSRTPStream > iStreamIter

TSglQueIter< CSRTPStream >iStreamIter[private]

CSRTPStream iterator.

TSglQueLink iStreamLink

TSglQueLink iStreamLink[private]

iStreamLink, Link to list.

TSglQue< CSRTPStream > iStreamList

TSglQue< CSRTPStream >iStreamList[private]

list of CSRTPStream objects