Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: SdpConnectionField.h
Link against: sdpcodec.lib

Class CSdpConnectionField

class CSdpConnectionField : public CBase;

Description

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

Derivation

Members

Defined in CSdpConnectionField:
Address(), AddressType(), CloneL(), DecodeL(), DecodeLC(), EncodeL(), InetAddress(), NetType(), NewL(), NewL(), NewLC(), NewLC(), NumOfAddress(), SetAddressL(), SetInetAddressL(), SetNumOfAddressL(), SetTTLL(), TTLValue(), operator==(), ~CSdpConnectionField()

Inherited from CBase:
Delete(), Extension_(), operator new()


Construction and destruction


NewL()

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

Description

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

Time-To-Live for IP4 multicasts, set it as KErrNotFound if IPv6 multicast or IPv4 unicast

TUint aNumOfAddress

Number of addresses in multicast, if unicast, must be 1

Return value

CSdpConnectionField *

a new instance.


NewL()

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

Description

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

Return value

CSdpConnectionField *

a new instance.


NewLC()

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

Description

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

Time-To-Live for IP4 multicasts, set it as KErrNotFound if IPv6 multicast or IPv4 unicast

TUint aNumOfAddress

Number of addresses in multicast, if unicast, must be 1

Return value

CSdpConnectionField *

a new instance.


NewLC()

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

Description

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

Return value

CSdpConnectionField *

a new instance.


~CSdpConnectionField()

IMPORT_C ~CSdpConnectionField();

Description

Deletes the resources held by the instance.

[Top]


Member functions


DecodeL()

static IMPORT_C CSdpConnectionField *DecodeL(const TDesC8 &aText);

Description

Constructs a new connection field.

Parameters

const TDesC8 &aText

A string containing a correctly formatted field value terminated by a CRLF.

Return value

CSdpConnectionField *

a new instance.


DecodeLC()

static IMPORT_C CSdpConnectionField *DecodeLC(const TDesC8 &aText);

Description

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.

Return value

CSdpConnectionField *

a new instance.


EncodeL()

IMPORT_C void EncodeL(RWriteStream &aStream) const;

Description

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

Parameters

RWriteStream &aStream


CloneL()

IMPORT_C CSdpConnectionField *CloneL() const;

Description

Creates a new instance that is equal to the target.

Return value

CSdpConnectionField *

a new instance.


operator==()

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

Description

Compares this instance to another for equality.

Parameters

const CSdpConnectionField &aObj

Return value

TBool

ETrue if equal, EFalse if not.


NetType()

IMPORT_C RStringF NetType() const;

Description

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

Return value

RStringF

The network type.


AddressType()

IMPORT_C RStringF AddressType() const;

Description

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

Return value

RStringF

The address type.


InetAddress()

IMPORT_C const TInetAddr *InetAddress() const;

Description

Gets the address.

Return value

const TInetAddr *

Address as an IP address or null if it is not an IP address. This may be e.g. when the address has been specified as a FQDN. In this case, the address can be accessed using the other getters.


Address()

IMPORT_C const TDesC8 &Address() const;

Description

Gets the address.

Return value

const TDesC8 &

Address as a string.


SetInetAddressL()

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

Description

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.

Parameters

const TInetAddr &aValue

The new address.

TInt aTTL

Time-To-Live for IP4 multicasts, set it as KErrNotFound if IPv6 multicast or IPv4 unicast

TUint aNumOfAddress

Number of addresses in multicast, if unicast, must be 1.

Leave codes

KErrSdpCodecConnectionField

ifaddress to be set is wrongly formatted.


SetAddressL()

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

Description

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.


TTLValue()

IMPORT_C TInt TTLValue() const;

Description

Gets TTL attribute.

Return value

TInt

TTL or KErrNotFound, if one is not available for the address


SetTTLL()

IMPORT_C void SetTTLL(TInt aTTL);

Description

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

Parameters

TInt aTTL

Time-To-Live for IP4 multicasts

Leave codes

KErrSdpCodecConnectionField

if aTTL is invalid.


NumOfAddress()

IMPORT_C TInt NumOfAddress() const;

Description

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

Return value

TInt

Number of addresses


SetNumOfAddressL()

IMPORT_C void SetNumOfAddressL(TUint aNumOfAddress);

Description

Sets the number of addreses allocated for multicast.

Parameters

TUint aNumOfAddress

Number of addresses in multicast

Leave codes

KErrSdpCodecConnectionField

if the address is unicast.