CSdpConnectionField Class Reference

class CSdpConnectionField : public CBase

This class encapsulates the connection information field of the Session Description Protocol.

The normative reference for correct formatting and values is draft-ietf-mmusic-sdp-new-14 unless specified otherwise in member documentation. The implementation supports this normative reference, but does not enforce it fully.

sdpcodec.lib

Inherits from

Public Member Functions
~CSdpConnectionField ()
IMPORT_C const TDesC8 & Address ()
IMPORT_C RStringF AddressType ()
IMPORT_C CSdpConnectionField * CloneL ()
IMPORT_C CSdpConnectionField * DecodeL (const TDesC8 &)
IMPORT_C CSdpConnectionField * DecodeLC (const TDesC8 &)
IMPORT_C void EncodeL ( RWriteStream &)
void ExternalizeL ( RWriteStream &)
IMPORT_C const TInetAddr * InetAddress ()
CSdpConnectionField * InternalizeL ( RReadStream &)
IMPORT_C RStringF NetType ()
IMPORT_C CSdpConnectionField * NewL (const TInetAddr &, TInt , TUint )
IMPORT_C CSdpConnectionField * NewL ( RStringF , RStringF , const TDesC8 &)
IMPORT_C CSdpConnectionField * NewLC (const TInetAddr &, TInt , TUint )
IMPORT_C CSdpConnectionField * NewLC ( RStringF , RStringF , const TDesC8 &)
IMPORT_C TInt NumOfAddress ()
IMPORT_C void SetAddressL ( RStringF , RStringF , const TDesC8 &)
IMPORT_C void SetInetAddressL (const TInetAddr &, TInt , TUint )
IMPORT_C void SetNumOfAddressL ( TUint )
IMPORT_C void SetTTLL ( TInt )
IMPORT_C TInt TTLValue ()
IMPORT_C TBool operator== (const CSdpConnectionField &)
Private Member Functions
CSdpConnectionField ()
void ConstructL (const TDesC8 &)
void ConstructL (const TInetAddr &, TInt , TUint )
void ConstructL ( RStringF , RStringF , const TDesC8 &)
void CopyAddressL (const TDesC8 &, RStringPool )
void CopyAddressTypeL (const TDesC8 &)
void CopyNetTypeL (const TDesC8 &)
TInt IsValidAddress ( TBool , const TDesC8 &)
TInt IsValidAddress (const TInetAddr &, TInt , TUint )
HBufC8 * ParseAddressFieldL ( TBool , const TDesC8 &, TInt &, TUint &)
HBufC8 * ParseIP4AddressL ( TInt , TInetAddr &, const TDesC8 &, TInt &, TUint &)
HBufC8 * ParseIP6AddressL ( TInt , TInetAddr &, const TDesC8 &, TInt &, TUint &)
void __DbgTestInvariant ()
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()
Private Attributes
HBufC8 * iAddress
RStringF iAddressType
TInetAddr iInetAddress
RStringF iNetType
TUint iNumOfAddress
RStringPool iPool
TInt iTTL

Constructor & Destructor Documentation

CSdpConnectionField()

CSdpConnectionField ( ) [private]

Constructor

~CSdpConnectionField()

IMPORT_C ~CSdpConnectionField ( )

Deletes the resources held by the instance.

Member Functions Documentation

Address()

IMPORT_C const TDesC8 & Address ( ) const

Gets the address.

AddressType()

IMPORT_C RStringF AddressType ( ) const

Gets the address type that is from the pre-defined SDP string table or given by the user.

CloneL()

IMPORT_C CSdpConnectionField * CloneL ( ) const

Creates a new instance that is equal to the target.

ConstructL(const TDesC8 &)

void ConstructL ( const TDesC8 & aText ) [private]

2nd phase constructor

Parameters

const TDesC8 & aText A string containing a correctly formatted field value terminated by a CRLF.

ConstructL(const TInetAddr &, TInt, TUint)

void ConstructL ( const TInetAddr & aAddress,
TInt aTTL,
TUint aNumOfAddress
) [private]

2nd phase constructor

Parameters

const TInetAddr & aAddress IP address from either KAfInet or KAfInet6 family
TInt aTTL Time-To-Live for IP4 multicasts
TUint aNumOfAddress Nubmer of addresses in multicast

ConstructL(RStringF, RStringF, const TDesC8 &)

void ConstructL ( RStringF aNetType,
RStringF aAddressType,
const TDesC8 & aAddress
) [private]

2nd phase constructor

Parameters

RStringF aNetType A valid network type name from the pre-defined SDP string table or defined by the user
RStringF aAddressType A valid address type name from the pre-defined SDP string table or defined by the user
const TDesC8 & aAddress A valid address of the address type

CopyAddressL(const TDesC8 &, RStringPool)

void CopyAddressL ( const TDesC8 & aAddress,
RStringPool aPool
) [private]

Copies address to iAddress, and initalizes TTL & number of addresses, leaves on error

Parameters

const TDesC8 & aAddress Address string, which can also contain TTL and number of addresses attributes
RStringPool aPool

CopyAddressTypeL(const TDesC8 &)

void CopyAddressTypeL ( const TDesC8 & aAddrType ) [private]

Copies given address type to iAddressType and verifies aAddrType to be valid

Parameters

const TDesC8 & aAddrType Given address type

CopyNetTypeL(const TDesC8 &)

void CopyNetTypeL ( const TDesC8 & aNetType ) [private]

Copies given network type to iNetType and verifies aNetType to be valid

Parameters

const TDesC8 & aNetType Given network type

DecodeL(const TDesC8 &)

IMPORT_C CSdpConnectionField * DecodeL ( const TDesC8 & aText ) [static]

Constructs a new connection field.

Parameters

const TDesC8 & aText A string containing a correctly formatted field value terminated by a CRLF.

DecodeLC(const TDesC8 &)

IMPORT_C CSdpConnectionField * DecodeLC ( const TDesC8 & aText ) [static]

Constructs a new connection field and adds the pointer to the cleanup stack.

Parameters

const TDesC8 & aText A string containing a correctly formatted field value terminated by a CRLF.

EncodeL(RWriteStream &)

IMPORT_C void EncodeL ( RWriteStream & aStream ) const

Outputs the field formatted according to SDP syntax and including the terminating CRLF.

Parameters

RWriteStream & aStream

ExternalizeL(RWriteStream &)

void ExternalizeL ( RWriteStream & aStream ) const

Externalizes the object to stream

Parameters

RWriteStream & aStream Stream where the object's state will be stored

InetAddress()

IMPORT_C const TInetAddr * InetAddress ( ) const

Gets the address.

InternalizeL(RReadStream &)

CSdpConnectionField * InternalizeL ( RReadStream & aStream ) [static]

Creates object from the stream data

Parameters

RReadStream & aStream Stream where the object's state will be read

IsValidAddress(TBool, const TDesC8 &)

TInt IsValidAddress ( TBool aAddressTypeIP4,
const TDesC8 & aAddress
) const [private]

Checks if the address is valid against given arguments

Parameters

TBool aAddressTypeIP4 The given type of address (EFalse = IP6)
const TDesC8 & aAddress Address with possibly TTL & number of addresses

IsValidAddress(const TInetAddr &, TInt, TUint)

TInt IsValidAddress ( const TInetAddr & aAddress,
TInt aTTL,
TUint aNumOfAddress
) const [private]

Checks if the address is valid against given arguments

Parameters

const TInetAddr & aAddress Address in TInetAddr format
TInt aTTL TTL attribute
TUint aNumOfAddress Number off addresses

NetType()

IMPORT_C RStringF NetType ( ) const

Gets the network type that is from the pre-defined SDP string table or given by the user.

NewL(const TInetAddr &, TInt, TUint)

IMPORT_C CSdpConnectionField * NewL ( const TInetAddr & aAddress,
TInt aTTL =  KErrNotFound ,
TUint aNumOfAddress =  KDefaultNumOfAddress
) [static]

Constructs a new connection field. Also sets the network type to "IN" and address type to "IP4" or "IP6" depending on the address family of aAddress.

Parameters

const TInetAddr & aAddress IP address from either KAfInet or KAfInet6 family
TInt aTTL =  KErrNotFound Time-To-Live for IP4 multicasts, set it as KErrNotFound if IPv6 multicast or IPv4 unicast
TUint aNumOfAddress =  KDefaultNumOfAddress Number of addresses in multicast, if unicast, must be 1

NewL(RStringF, RStringF, const TDesC8 &)

IMPORT_C CSdpConnectionField * NewL ( RStringF aNetType,
RStringF aAddressType,
const TDesC8 & aAddress
) [static]

Constructs a new connection field.

Parameters

RStringF aNetType A valid network type name from the pre- defined SDP string table or defined by the user. A valid address type name from the pre-defined SDP string table or defined by the user.
RStringF aAddressType
const TDesC8 & aAddress

NewLC(const TInetAddr &, TInt, TUint)

IMPORT_C CSdpConnectionField * NewLC ( const TInetAddr & aAddress,
TInt aTTL =  KErrNotFound ,
TUint aNumOfAddress =  KDefaultNumOfAddress
) [static]

Constructs a new connection field and adds the pointer to the cleanup stack. Also sets the network type to "IN" and address type to "IP4" or "IP6" depending on the address family of aAddress.

Parameters

const TInetAddr & aAddress IP address from either KAfInet or KAfInet6 family
TInt aTTL =  KErrNotFound Time-To-Live for IP4 multicasts, set it as KErrNotFound if IPv6 multicast or IPv4 unicast
TUint aNumOfAddress =  KDefaultNumOfAddress Number of addresses in multicast, if unicast, must be 1

NewLC(RStringF, RStringF, const TDesC8 &)

IMPORT_C CSdpConnectionField * NewLC ( RStringF aNetType,
RStringF aAddressType,
const TDesC8 & aAddress
) [static]

Construct a new connection field and adds the pointer to the cleanup stack.

Parameters

RStringF aNetType A valid network type name from the pre- defined SDP string table or defined by the user A valid address type name from the pre-defined SDP string table or defined by the user
RStringF aAddressType
const TDesC8 & aAddress

NumOfAddress()

IMPORT_C TInt NumOfAddress ( ) const

Gets the number of addresses (can be more than 1 for multicasts). Multicast addresses are contiguously allocated above the base address.

ParseAddressFieldL(TBool, const TDesC8 &, TInt &, TUint &)

HBufC8 * ParseAddressFieldL ( TBool aAddressTypeIP4,
const TDesC8 & aAddress,
TInt & aTTL,
TUint & aNumberOfAddresses
) const [private]

Parses address field

Parameters

TBool aAddressTypeIP4 The given type of address (EFalse = IP6)
const TDesC8 & aAddress Address with possibly TTL & number of addresses
TInt & aTTL TTL value is stored here (or KErrNotFound)
TUint & aNumberOfAddresses Range of addreses

ParseIP4AddressL(TInt, TInetAddr &, const TDesC8 &, TInt &, TUint &)

HBufC8 * ParseIP4AddressL ( TInt aPos,
TInetAddr & aAddr,
const TDesC8 & aAddress,
TInt & aTTL,
TUint & aNumberOfAddresses
) const [private]

Parses IP4 address

Parameters

TInt aPos Position of the (first) separation mark
TInetAddr & aAddr Addres in TInetAddr format
const TDesC8 & aAddress The whole address field
TInt & aTTL TTL value is stored here (or KErrNotFound)
TUint & aNumberOfAddresses Range of addreses

ParseIP6AddressL(TInt, TInetAddr &, const TDesC8 &, TInt &, TUint &)

HBufC8 * ParseIP6AddressL ( TInt aPos,
TInetAddr & aAddr,
const TDesC8 & aAddress,
TInt & aTTL,
TUint & aNumberOfAddresses
) const [private]

Parses IP6 address

Parameters

TInt aPos Position of the (first) separation mark
TInetAddr & aAddr Addres in TInetAddr format
const TDesC8 & aAddress The whole address field
TInt & aTTL TTL value is stored here (or KErrNotFound)
TUint & aNumberOfAddresses Range of addreses

SetAddressL(RStringF, RStringF, const TDesC8 &)

IMPORT_C void SetAddressL ( RStringF aNetType,
RStringF aAddressType,
const TDesC8 & aAddress
)

Sets the address, network and address type.

Parameters

RStringF aNetType A valid network type name from the pre- defined SDP string table or defined by the user
RStringF aAddressType A valid address type name from the pre-defined SDP string table or defined by the user
const TDesC8 & aAddress A valid address of the address type.

SetInetAddressL(const TInetAddr &, TInt, TUint)

IMPORT_C void SetInetAddressL ( const TInetAddr & aValue,
TInt aTTL =  KErrNotFound ,
TUint aNumOfAddress =  KDefaultNumOfAddress
)

Sets the address, network and address type. Also sets the network type to "IN" and address type to "IP4" or "IP6" depending on the address family of aAddress.

leave
KErrSdpCodecConnectionField ifaddress to be set is wrongly formatted.

Parameters

const TInetAddr & aValue The new address.
TInt aTTL =  KErrNotFound Time-To-Live for IP4 multicasts, set it as KErrNotFound if IPv6 multicast or IPv4 unicast
TUint aNumOfAddress =  KDefaultNumOfAddress Number of addresses in multicast, if unicast, must be 1.

SetNumOfAddressL(TUint)

IMPORT_C void SetNumOfAddressL ( TUint aNumOfAddress )

Sets the number of addreses allocated for multicast.

leave
KErrSdpCodecConnectionField if the address is unicast.

Parameters

TUint aNumOfAddress Number of addresses in multicast

SetTTLL(TInt)

IMPORT_C void SetTTLL ( TInt aTTL )

Sets TTL attribute (only valid for IP4 multicasts). Leaves if trying to set TTL to address that doesn't support it.

leave
KErrSdpCodecConnectionField if aTTL is invalid.

Parameters

TInt aTTL Time-To-Live for IP4 multicasts

TTLValue()

IMPORT_C TInt TTLValue ( ) const

Gets TTL attribute.

__DbgTestInvariant()

void __DbgTestInvariant ( ) const [private]

operator==(const CSdpConnectionField &)

IMPORT_C TBool operator== ( const CSdpConnectionField & aObj ) const

Compares this instance to another for equality.

Parameters

const CSdpConnectionField & aObj

Member Data Documentation

HBufC8 * iAddress

HBufC8 * iAddress [private]

RStringF iAddressType

RStringF iAddressType [private]

TInetAddr iInetAddress

TInetAddr iInetAddress [private]

RStringF iNetType

RStringF iNetType [private]

TUint iNumOfAddress

TUint iNumOfAddress [private]

RStringPool iPool

RStringPool iPool [private]

TInt iTTL

TInt iTTL [private]