class TIp6Addr |
The 128 bits of IPv6 or IPv4 address stored in network byte order.
IPv4 addresses are stored in IPv4 mapped format.
Public Member Functions | |
---|---|
IMPORT_C TBool | IsEqual (const TIp6Addr &) |
IMPORT_C TBool | IsLinkLocal () |
IMPORT_C TBool | IsLoopback () |
IMPORT_C TBool | IsMulticast () |
IMPORT_C TBool | IsSiteLocal () |
IMPORT_C TBool | IsUnicast () |
IMPORT_C TBool | IsUnspecified () |
IMPORT_C TBool | IsV4Compat () |
IMPORT_C TBool | IsV4Mapped () |
IMPORT_C TInt | Match (const TIp6Addr &) |
IMPORT_C TInt | Scope () |
Public Attributes | |
---|---|
TUint16 | iAddr16 |
TUint32 | iAddr32 |
TUint8 | iAddr8 |
union TIp6Addr::@27 | u |
IMPORT_C TBool | IsEqual | ( | const TIp6Addr & | aAddr | ) | const |
Tests if two addresses are equal.
const TIp6Addr & aAddr | Address to compare with |
IMPORT_C TBool | IsLinkLocal | ( | ) | const |
IMPORT_C TBool | IsMulticast | ( | ) | const |
IMPORT_C TBool | IsSiteLocal | ( | ) | const |
IMPORT_C TBool | IsUnspecified | ( | ) | const |
IMPORT_C TBool | IsV4Compat | ( | ) | const |
Tests if this address is an IPv4-compatible address.
returns EFalse for ::0.0.0.0 (= :: ) and ::0.0.0.1 (= ::1 ).
IMPORT_C TBool | IsV4Mapped | ( | ) | const |
IMPORT_C TInt | Match | ( | const TIp6Addr & | aAddr | ) | const |
Compares two raw IPv6 addresses from left to right and returns the number of bits that match.
const TIp6Addr & aAddr | Address to compare with |
IMPORT_C TInt | Scope | ( | ) | 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
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.