diff options
author | Marek Safar <marek.safar@gmail.com> | 2014-01-12 12:34:55 +0400 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2014-01-12 12:34:55 +0400 |
commit | 111e40018a113dd5d95526b91f536ed7d30c009d (patch) | |
tree | 6e24c01520c9e472bd4124f9255f989e4dc0a45d /mcs | |
parent | de413aa54e6acac806f684cf14cb656c1aea85f1 (diff) | |
parent | d27abb23af5eb9d288be117b4e1106cf3ac75bf7 (diff) |
Merge pull request #870 from wayoutmind/master
[system] Add IsIPv6Teredo to System.Net.IpAddress
Diffstat (limited to 'mcs')
-rwxr-xr-x | mcs/class/System/Documentation/en/System.Net/IPAddress.xml | 15 | ||||
-rw-r--r-- | mcs/class/System/System.Net/IPAddress.cs | 10 | ||||
-rw-r--r-- | mcs/class/System/Test/System.Net/IPAddressTest.cs | 9 |
3 files changed, 34 insertions, 0 deletions
diff --git a/mcs/class/System/Documentation/en/System.Net/IPAddress.xml b/mcs/class/System/Documentation/en/System.Net/IPAddress.xml index f2caec0386d..e428def11c2 100755 --- a/mcs/class/System/Documentation/en/System.Net/IPAddress.xml +++ b/mcs/class/System/Documentation/en/System.Net/IPAddress.xml @@ -541,6 +541,21 @@ in network-byte-order.</para> <remarks>To be added.</remarks> </Docs> </Member> + <Member MemberName="IsIPv6Teredo"> + <MemberSignature Language="C#" Value="public bool IsIPv6Teredo { get; }" /> + <MemberType>Property</MemberType> + <AssemblyInfo> + <AssemblyVersion>4.0.0.0</AssemblyVersion> + </AssemblyInfo> + <ReturnValue> + <ReturnType>System.Boolean</ReturnType> + </ReturnValue> + <Docs> + <summary>To be added.</summary> + <value>To be added.</value> + <remarks>To be added.</remarks> + </Docs> + </Member> <Member MemberName="IsLoopback"> <MemberSignature Language="ILASM" Value=".method public hidebysig static bool IsLoopback(class System.Net.IPAddress address)" /> <MemberSignature Language="C#" Value="public static bool IsLoopback (System.Net.IPAddress addr);" /> diff --git a/mcs/class/System/System.Net/IPAddress.cs b/mcs/class/System/System.Net/IPAddress.cs index 2dd7d1ab311..b1081f5bd29 100644 --- a/mcs/class/System/System.Net/IPAddress.cs +++ b/mcs/class/System/System.Net/IPAddress.cs @@ -333,6 +333,16 @@ namespace System.Net { } } +#if NET_4_0 + public bool IsIPv6Teredo { + get { + return m_Family != AddressFamily.InterNetwork && + m_Numbers[0] == 0x2001 && + m_Numbers[1] == 0; + } + } +#endif + public long ScopeId { get { if (m_Family != AddressFamily.InterNetworkV6) diff --git a/mcs/class/System/Test/System.Net/IPAddressTest.cs b/mcs/class/System/Test/System.Net/IPAddressTest.cs index 965b1cd44a0..a07c1a19d92 100644 --- a/mcs/class/System/Test/System.Net/IPAddressTest.cs +++ b/mcs/class/System/Test/System.Net/IPAddressTest.cs @@ -545,6 +545,15 @@ public class IPAddressTest Assert.IsTrue (IPAddress.Parse ("FF01::1").IsIPv6Multicast, "#2"); Assert.IsFalse (IPAddress.Parse ("FE00::1").IsIPv6Multicast, "#3"); } + +#if NET_4_0 + [Test] + public void IsIPv6Teredo () + { + Assert.IsTrue (IPAddress.Parse ("2001::1").IsIPv6Teredo, "#1"); + Assert.IsFalse (IPAddress.Parse ("2002::1").IsIPv6Teredo, "#2"); + } +#endif } } |