RFC 3849 - IPv6 Address Prefix Reserved for Documentation

This commit is contained in:
Tommaso Pecorella
2013-07-10 00:06:35 +02:00
parent f2cd231aec
commit 6550570e50
5 changed files with 31 additions and 0 deletions

View File

@@ -522,6 +522,19 @@ bool Ipv6Address::IsAny () const
return (*this == any);
}
bool Ipv6Address::IsDocumentation () const
{
NS_LOG_FUNCTION (this);
Ipv6Address documentation ("2001:db8::0");
if (((Ipv6Address*)this)->CombinePrefix (Ipv6Prefix (32)) == documentation)
{
return true;
}
return false;
}
bool Ipv6Address::IsMatchingType (const Address& address)
{
NS_LOG_FUNCTION (address);

View File

@@ -212,6 +212,12 @@ public:
*/
bool IsAny () const;
/**
* \brief If the IPv6 address is a documentation address (2001:DB8::/32).
* \return true if the address is documentation, false otherwise
*/
bool IsDocumentation () const;
/**
* \brief Combine this address with a prefix.
* \param prefix a IPv6 prefix