TIp6Addr Class Reference

#include <in_sock.h>

Link against: insock.lib

class TIp6Addr
Public Attributes
TUint16 iAddr16
TUint32 iAddr32
TUint8 iAddr8
union TIp6Addr::@27u
Public Member Functions
IMPORT_C TBoolIsEqual(const TIp6Addr &)
IMPORT_C TBoolIsLinkLocal()
IMPORT_C TBoolIsLoopback()
IMPORT_C TBoolIsMulticast()
IMPORT_C TBoolIsSiteLocal()
IMPORT_C TBoolIsUnicast()
IMPORT_C TBoolIsUnspecified()
IMPORT_C TBoolIsV4Compat()
IMPORT_C TBoolIsV4Mapped()
IMPORT_C TIntMatch(const TIp6Addr &)
IMPORT_C TIntScope()

Detailed Description

The 128 bits of IPv6 or IPv4 address stored in network byte order.

IPv4 addresses are stored in IPv4 mapped format.

Since
7.0

Member Attribute Documentation

iAddr16

TUint16 iAddr16

iAddr32

TUint32 iAddr32

iAddr8

TUint8 iAddr8

u

union TIp6Addr::@27u

Member Function Documentation

IsEqual ( const TIp6Addr & )

IMPORT_C TBoolIsEqual(const TIp6Addr &aAddr)const

Tests if two addresses are equal.

Since
7.0
ParameterDescription
aAddrAddress to compare with

Returns: ETrue, if the addresses are equal; EFalse, otherwise.

IsLinkLocal ( )

IMPORT_C TBoolIsLinkLocal()const
Tests if the address is an IPv6 link-local address.
Since
7.0

Returns: ETrue, if this address is an IPv6 link-local address (fe80::/10); EFalse, otherwise.

IsLoopback ( )

IMPORT_C TBoolIsLoopback()const
Tests if the address is IPv6 loopback.
Since
7.0

Returns: ETrue, if the address is loopback (::1); EFalse, otherwise.

IsMulticast ( )

IMPORT_C TBoolIsMulticast()const
Tests if the IPv6 address is multicast.
Since
7.0

Returns: ETrue, if the IP address value is IPv6 multicast (ff00::/8); EFalse, otherwise.

IsSiteLocal ( )

IMPORT_C TBoolIsSiteLocal()const
Tests if this address is an IPv6 site-local address (fec0::/10).
Since
7.0

Returns: ETrue, if this is an IPv6 site-local address (fec0::/10); EFalse, otherwise.

IsUnicast ( )

IMPORT_C TBoolIsUnicast()const
Tests if the address is IPv6 unicast.
Since
7.0

Returns: ETrue, if the address is unicast (not IPv6 unspecified or multicast); EFalse, otherwise.

IsUnspecified ( )

IMPORT_C TBoolIsUnspecified()const
Tests if the address is IPv6 unspecified.
Since
7.0

Returns: ETrue, if the IP address value is zero (= ::); EFalse, otherwise.

IsV4Compat ( )

IMPORT_C TBoolIsV4Compat()const

Tests if this address is an IPv4-compatible address.

Note:

returns EFalse for ::0.0.0.0 (= ::) and ::0.0.0.1 (= ::1).

Deprecated
Since
7.0

Returns: ETrue, if this is a IPv4-compatible address (x.x.x.x); EFalse, otherwise.

IsV4Mapped ( )

IMPORT_C TBoolIsV4Mapped()const
Tests if this address is an IPv4-mapped address.
Since
7.0

Returns: ETrue, if this address is an IPv4-mapped address (ffff:x.x.x.x); EFalse, otherwise.

Match ( const TIp6Addr & )

IMPORT_C TIntMatch(const TIp6Addr &aAddr)const

Compares two raw IPv6 addresses from left to right and returns the number of bits that match.

Since
7.0
ParameterDescription
aAddrAddress to compare with

Returns: The number of bits that match (the common prefix length).

Scope ( )

IMPORT_C TIntScope()const

Return the scope level of the addres.

All IP addresses (IPv4 and IPv6) have a scope level as defined by this function. The scope level is a positive integer in range [1..16].

This function may also return 0, which is an invalid level. This can happen only, because IPv6 multicast addresses specify their scope level explicitly.

The scope level determines the interpretation of the scope identifier in TInetAddr (see TInetAddr::Scope(), TInetAddr::SetScope()).

Each network interface has a vector of 16 scope identifiers. The scope identifier in the destination address selects a subset of the possible interfaces: only the interfaces which have the correct matching scope identifier in the vector entry matching the scope level, are valid destinations for that address.

The scope level of an IP address is computed as follows:

  • ffyz::/10 -- IPv6 multicast addressess, the scope level is extracted from the address (= z)

  • fe80::/10 -- IPv6 link local addresses, return KIp6AddrScopeLinkLocal

  • fec0::/10 -- IPv6 site local addresses, return KIp6AddrScopeSiteLocal

  • ::1/128 -- IPv6 loopback address, return KIp6AddrScopeNodeLocal

  • ::/128 -- IPv6 unspecified address, return KIp6AddrScopeNodeLocal

  • ffff:0.0.0.0 -- IPv4 unspecified address, return KIp6AddrScopeNodeLocal

  • ffff:169.254.x.x/112 -- IPv4 link local range, return KIp6AddrScopeLinkLocal

  • ffff:224.0.0.x/120 -- IPv4 link local multicast range, return KIp6AddrScopeLinkLocal

  • ffff:127.x.x.x/104 -- IPv4 loopback addresses, return KIp6AddrScopeNodeLocal

  • ffff:0.0.0.0/96 -- all other IPv4 addresses, return KIp6AddrScopeNetwork

  • None of the above -- assume global IPv6 addresses, return KIp6AddrScopeGlobal

Since
7.0

Returns: The scope value of the address (e.g. KIp6AddrScopeNodeLocal, KIp6AddrScopeLinkLocal, KIp6AddrScopeSiteLocal, KIp6AddrScopeOrganization, KIp6AddrScopeGlobal or KIp6AddrScopeNetwork).