Fix UnsupportedOSPlatformAttribute usage in System.Net.NetworkInformation.cs (#72792)
authorRadek Zikmund <32671551+rzikm@users.noreply.github.com>
Fri, 29 Jul 2022 10:56:02 +0000 (12:56 +0200)
committerGitHub <noreply@github.com>
Fri, 29 Jul 2022 10:56:02 +0000 (12:56 +0200)
* Test attribute on IsDnsEligible

* Add more attributes

* Icmp statistics

* IPGlobalProperties

* IPInterfaceProperties

* IPInterfaceStatistics

* Replace unsupportedOS attribute by SupportedOS attribute

* IPv4/6InterfaceProperties

src/libraries/System.Net.NetworkInformation/ref/System.Net.NetworkInformation.cs
src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/IPAddressInformation.cs
src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/IPGlobalProperties.cs
src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/IPInterfaceProperties.cs
src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/IPInterfaceStatistics.cs
src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/IPv4InterfaceProperties.cs
src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/IPv6InterfaceProperties.cs
src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/IcmpV4Statistics.cs
src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/IcmpV6Statistics.cs
src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/MulticastIPAddressInformation.cs
src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/UnicastIPAddressInformation.cs

index df04b53..da345ad 100644 (file)
@@ -46,9 +46,25 @@ namespace System.Net.NetworkInformation
         public abstract long EchoRepliesSent { get; }
         public abstract long EchoRequestsReceived { get; }
         public abstract long EchoRequestsSent { get; }
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("freebsd")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("osx")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")]
         public abstract long ErrorsReceived { get; }
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("freebsd")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("osx")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")]
         public abstract long ErrorsSent { get; }
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("freebsd")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("osx")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")]
         public abstract long MessagesReceived { get; }
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("freebsd")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("osx")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")]
         public abstract long MessagesSent { get; }
         public abstract long ParameterProblemsReceived { get; }
         public abstract long ParameterProblemsSent { get; }
@@ -72,7 +88,15 @@ namespace System.Net.NetworkInformation
         public abstract long EchoRepliesSent { get; }
         public abstract long EchoRequestsReceived { get; }
         public abstract long EchoRequestsSent { get; }
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("freebsd")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("osx")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")]
         public abstract long ErrorsReceived { get; }
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("freebsd")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("osx")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")]
         public abstract long ErrorsSent { get; }
         public abstract long MembershipQueriesReceived { get; }
         public abstract long MembershipQueriesSent { get; }
@@ -80,7 +104,15 @@ namespace System.Net.NetworkInformation
         public abstract long MembershipReductionsSent { get; }
         public abstract long MembershipReportsReceived { get; }
         public abstract long MembershipReportsSent { get; }
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("freebsd")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("osx")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")]
         public abstract long MessagesReceived { get; }
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("freebsd")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("osx")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")]
         public abstract long MessagesSent { get; }
         public abstract long NeighborAdvertisementsReceived { get; }
         public abstract long NeighborAdvertisementsSent { get; }
@@ -103,7 +135,9 @@ namespace System.Net.NetworkInformation
     {
         protected IPAddressInformation() { }
         public abstract System.Net.IPAddress Address { get; }
+        [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
         public abstract bool IsDnsEligible { get; }
+        [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
         public abstract bool IsTransient { get; }
     }
     public partial class IPAddressInformationCollection : System.Collections.Generic.ICollection<System.Net.NetworkInformation.IPAddressInformation>, System.Collections.Generic.IEnumerable<System.Net.NetworkInformation.IPAddressInformation>, System.Collections.IEnumerable
@@ -123,37 +157,41 @@ namespace System.Net.NetworkInformation
     public abstract partial class IPGlobalProperties
     {
         protected IPGlobalProperties() { }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract string DhcpScopeName { get; }
         public abstract string DomainName { get; }
         public abstract string HostName { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract bool IsWinsProxy { get; }
         public abstract System.Net.NetworkInformation.NetBiosNodeType NodeType { get; }
         public virtual System.IAsyncResult BeginGetUnicastAddresses(System.AsyncCallback? callback, object? state) { throw null; }
         public virtual System.Net.NetworkInformation.UnicastIPAddressInformationCollection EndGetUnicastAddresses(System.IAsyncResult asyncResult) { throw null; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract System.Net.NetworkInformation.TcpConnectionInformation[] GetActiveTcpConnections();
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract System.Net.IPEndPoint[] GetActiveTcpListeners();
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract System.Net.IPEndPoint[] GetActiveUdpListeners();
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract System.Net.NetworkInformation.IcmpV4Statistics GetIcmpV4Statistics();
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract System.Net.NetworkInformation.IcmpV6Statistics GetIcmpV6Statistics();
-        [System.Runtime.Versioning.UnsupportedOSPlatform("illumos")]
-        [System.Runtime.Versioning.UnsupportedOSPlatform("solaris")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("illumos")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("solaris")]
         public static System.Net.NetworkInformation.IPGlobalProperties GetIPGlobalProperties() { throw null; }
         public abstract System.Net.NetworkInformation.IPGlobalStatistics GetIPv4GlobalStatistics();
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("freebsd")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("osx")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")]
         public abstract System.Net.NetworkInformation.IPGlobalStatistics GetIPv6GlobalStatistics();
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract System.Net.NetworkInformation.TcpStatistics GetTcpIPv4Statistics();
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract System.Net.NetworkInformation.TcpStatistics GetTcpIPv6Statistics();
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract System.Net.NetworkInformation.UdpStatistics GetUdpIPv4Statistics();
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract System.Net.NetworkInformation.UdpStatistics GetUdpIPv6Statistics();
         public virtual System.Net.NetworkInformation.UnicastIPAddressInformationCollection GetUnicastAddresses() { throw null; }
         public virtual System.Threading.Tasks.Task<System.Net.NetworkInformation.UnicastIPAddressInformationCollection> GetUnicastAddressesAsync() { throw null; }
@@ -161,69 +199,81 @@ namespace System.Net.NetworkInformation
     public abstract partial class IPGlobalStatistics
     {
         protected IPGlobalStatistics() { }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract int DefaultTtl { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract bool ForwardingEnabled { get; }
         public abstract int NumberOfInterfaces { get; }
         public abstract int NumberOfIPAddresses { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract int NumberOfRoutes { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract long OutputPacketRequests { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract long OutputPacketRoutingDiscards { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract long OutputPacketsDiscarded { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract long OutputPacketsWithNoRoute { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract long PacketFragmentFailures { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract long PacketReassembliesRequired { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract long PacketReassemblyFailures { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract long PacketReassemblyTimeout { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract long PacketsFragmented { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract long PacketsReassembled { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract long ReceivedPackets { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract long ReceivedPacketsDelivered { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract long ReceivedPacketsDiscarded { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract long ReceivedPacketsForwarded { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract long ReceivedPacketsWithAddressErrors { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract long ReceivedPacketsWithHeadersErrors { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract long ReceivedPacketsWithUnknownProtocol { get; }
     }
     public abstract partial class IPInterfaceProperties
     {
         protected IPInterfaceProperties() { }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
         public abstract System.Net.NetworkInformation.IPAddressInformationCollection AnycastAddresses { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("freebsd")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("osx")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")]
         public abstract System.Net.NetworkInformation.IPAddressCollection DhcpServerAddresses { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract System.Net.NetworkInformation.IPAddressCollection DnsAddresses { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract string DnsSuffix { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public abstract System.Net.NetworkInformation.GatewayIPAddressInformationCollection GatewayAddresses { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("freebsd")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("osx")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")]
         public abstract bool IsDnsEnabled { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
         public abstract bool IsDynamicDnsEnabled { get; }
         public abstract System.Net.NetworkInformation.MulticastIPAddressInformationCollection MulticastAddresses { get; }
         public abstract System.Net.NetworkInformation.UnicastIPAddressInformationCollection UnicastAddresses { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("freebsd")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("osx")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")]
         public abstract System.Net.NetworkInformation.IPAddressCollection WinsServersAddresses { get; }
         public abstract System.Net.NetworkInformation.IPv4InterfaceProperties GetIPv4Properties();
         public abstract System.Net.NetworkInformation.IPv6InterfaceProperties GetIPv6Properties();
@@ -235,13 +285,15 @@ namespace System.Net.NetworkInformation
         public abstract long BytesSent { get; }
         public abstract long IncomingPacketsDiscarded { get; }
         public abstract long IncomingPacketsWithErrors { get; }
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("linux")]
         public abstract long IncomingUnknownProtocolPackets { get; }
         public abstract long NonUnicastPacketsReceived { get; }
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("linux")]
         public abstract long NonUnicastPacketsSent { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("osx")]
-        [System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
-        [System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
-        [System.Runtime.Versioning.UnsupportedOSPlatform("freebsd")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("freebsd")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("osx")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")]
         public abstract long OutgoingPacketsDiscarded { get; }
         public abstract long OutgoingPacketsWithErrors { get; }
         public abstract long OutputQueueLength { get; }
@@ -252,16 +304,18 @@ namespace System.Net.NetworkInformation
     {
         protected IPv4InterfaceProperties() { }
         public abstract int Index { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
         public abstract bool IsAutomaticPrivateAddressingActive { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
         public abstract bool IsAutomaticPrivateAddressingEnabled { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
         public abstract bool IsDhcpEnabled { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
+        [System.Runtime.Versioning.SupportedOSPlatformAttribute("linux")]
         public abstract bool IsForwardingEnabled { get; }
         public abstract int Mtu { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
+        [System.Runtime.Versioning.SupportedOSPlatformAttribute("linux")]
         public abstract bool UsesWins { get; }
     }
     public abstract partial class IPv4InterfaceStatistics
@@ -274,10 +328,10 @@ namespace System.Net.NetworkInformation
         public abstract long IncomingUnknownProtocolPackets { get; }
         public abstract long NonUnicastPacketsReceived { get; }
         public abstract long NonUnicastPacketsSent { get; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("osx")]
-        [System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
-        [System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
-        [System.Runtime.Versioning.UnsupportedOSPlatform("freebsd")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("freebsd")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("osx")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")]
         public abstract long OutgoingPacketsDiscarded { get; }
         public abstract long OutgoingPacketsWithErrors { get; }
         public abstract long OutputQueueLength { get; }
@@ -289,16 +343,26 @@ namespace System.Net.NetworkInformation
         protected IPv6InterfaceProperties() { }
         public abstract int Index { get; }
         public abstract int Mtu { get; }
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("freebsd")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("osx")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")]
         public virtual long GetScopeId(System.Net.NetworkInformation.ScopeLevel scopeLevel) { throw null; }
     }
     public abstract partial class MulticastIPAddressInformation : System.Net.NetworkInformation.IPAddressInformation
     {
         protected MulticastIPAddressInformation() { }
+        [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
         public abstract long AddressPreferredLifetime { get; }
+        [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
         public abstract long AddressValidLifetime { get; }
+        [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
         public abstract long DhcpLeaseLifetime { get; }
+        [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
         public abstract System.Net.NetworkInformation.DuplicateAddressDetectionState DuplicateAddressDetectionState { get; }
+        [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
         public abstract System.Net.NetworkInformation.PrefixOrigin PrefixOrigin { get; }
+        [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
         public abstract System.Net.NetworkInformation.SuffixOrigin SuffixOrigin { get; }
     }
     public partial class MulticastIPAddressInformationCollection : System.Collections.Generic.ICollection<System.Net.NetworkInformation.MulticastIPAddressInformation>, System.Collections.Generic.IEnumerable<System.Net.NetworkInformation.MulticastIPAddressInformation>, System.Collections.IEnumerable
@@ -335,11 +399,11 @@ namespace System.Net.NetworkInformation
         [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
         [System.ObsoleteAttribute("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", true)]
         public NetworkChange() { }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("illumos")]
-        [System.Runtime.Versioning.UnsupportedOSPlatform("solaris")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("illumos")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("solaris")]
         public static event System.Net.NetworkInformation.NetworkAddressChangedEventHandler? NetworkAddressChanged { add { } remove { } }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("illumos")]
-        [System.Runtime.Versioning.UnsupportedOSPlatform("solaris")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("illumos")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("solaris")]
         public static event System.Net.NetworkInformation.NetworkAvailabilityChangedEventHandler? NetworkAvailabilityChanged { add { } remove { } }
         [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
         [System.ObsoleteAttribute("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", true)]
@@ -357,28 +421,28 @@ namespace System.Net.NetworkInformation
         protected NetworkInterface() { }
         public virtual string Description { get { throw null; } }
         public virtual string Id { get { throw null; } }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("illumos")]
-        [System.Runtime.Versioning.UnsupportedOSPlatform("solaris")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("illumos")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("solaris")]
         public static int IPv6LoopbackInterfaceIndex { get { throw null; } }
         public virtual bool IsReceiveOnly { get { throw null; } }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("illumos")]
-        [System.Runtime.Versioning.UnsupportedOSPlatform("solaris")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("illumos")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("solaris")]
         public static int LoopbackInterfaceIndex { get { throw null; } }
         public virtual string Name { get { throw null; } }
         public virtual System.Net.NetworkInformation.NetworkInterfaceType NetworkInterfaceType { get { throw null; } }
         public virtual System.Net.NetworkInformation.OperationalStatus OperationalStatus { get { throw null; } }
         public virtual long Speed { get { throw null; } }
         public virtual bool SupportsMulticast { get { throw null; } }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("illumos")]
-        [System.Runtime.Versioning.UnsupportedOSPlatform("solaris")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("illumos")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("solaris")]
         public static System.Net.NetworkInformation.NetworkInterface[] GetAllNetworkInterfaces() { throw null; }
         public virtual System.Net.NetworkInformation.IPInterfaceProperties GetIPProperties() { throw null; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public virtual System.Net.NetworkInformation.IPInterfaceStatistics GetIPStatistics() { throw null; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("android")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
         public virtual System.Net.NetworkInformation.IPv4InterfaceStatistics GetIPv4Statistics() { throw null; }
-        [System.Runtime.Versioning.UnsupportedOSPlatform("illumos")]
-        [System.Runtime.Versioning.UnsupportedOSPlatform("solaris")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("illumos")]
+        [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("solaris")]
         public static bool GetIsNetworkAvailable() { throw null; }
         public virtual System.Net.NetworkInformation.PhysicalAddress GetPhysicalAddress() { throw null; }
         public virtual bool Supports(System.Net.NetworkInformation.NetworkInterfaceComponent networkInterfaceComponent) { throw null; }
@@ -433,14 +497,14 @@ namespace System.Net.NetworkInformation
     {
         public static readonly System.Net.NetworkInformation.PhysicalAddress None;
         public PhysicalAddress(byte[] address) { }
-        public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? comparand) { throw null; }
+        public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? comparand) { throw null; }
         public byte[] GetAddressBytes() { throw null; }
         public override int GetHashCode() { throw null; }
+        public static System.Net.NetworkInformation.PhysicalAddress Parse(System.ReadOnlySpan<char> address) { throw null; }
         public static System.Net.NetworkInformation.PhysicalAddress Parse(string? address) { throw null; }
-        public static System.Net.NetworkInformation.PhysicalAddress Parse(ReadOnlySpan<char> address) { throw null; }
-        public static bool TryParse(string? address, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Net.NetworkInformation.PhysicalAddress? value) { throw null; }
-        public static bool TryParse(ReadOnlySpan<char> address, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Net.NetworkInformation.PhysicalAddress? value) { throw null; }
         public override string ToString() { throw null; }
+        public static bool TryParse(System.ReadOnlySpan<char> address, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Net.NetworkInformation.PhysicalAddress? value) { throw null; }
+        public static bool TryParse(string? address, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Net.NetworkInformation.PhysicalAddress? value) { throw null; }
     }
     public enum PrefixOrigin
     {
@@ -523,13 +587,19 @@ namespace System.Net.NetworkInformation
     public abstract partial class UnicastIPAddressInformation : System.Net.NetworkInformation.IPAddressInformation
     {
         protected UnicastIPAddressInformation() { }
+        [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
         public abstract long AddressPreferredLifetime { get; }
+        [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
         public abstract long AddressValidLifetime { get; }
+        [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
         public abstract long DhcpLeaseLifetime { get; }
+        [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
         public abstract System.Net.NetworkInformation.DuplicateAddressDetectionState DuplicateAddressDetectionState { get; }
         public abstract System.Net.IPAddress IPv4Mask { get; }
         public virtual int PrefixLength { get { throw null; } }
+        [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
         public abstract System.Net.NetworkInformation.PrefixOrigin PrefixOrigin { get; }
+        [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
         public abstract System.Net.NetworkInformation.SuffixOrigin SuffixOrigin { get; }
     }
     public partial class UnicastIPAddressInformationCollection : System.Collections.Generic.ICollection<System.Net.NetworkInformation.UnicastIPAddressInformation>, System.Collections.Generic.IEnumerable<System.Net.NetworkInformation.UnicastIPAddressInformation>, System.Collections.IEnumerable
index 9369864..87d0f7d 100644 (file)
@@ -1,6 +1,8 @@
 // Licensed to the .NET Foundation under one or more agreements.
 // The .NET Foundation licenses this file to you under the MIT license.
 
+using System.Runtime.Versioning;
+
 namespace System.Net.NetworkInformation
 {
     /// <summary>
@@ -16,11 +18,13 @@ namespace System.Net.NetworkInformation
         /// <summary>
         /// Gets a bool value that indicates whether the Internet Protocol (IP) address is legal to appear in a Domain Name System (DNS) server database.
         /// </summary>
+        [SupportedOSPlatform("windows")]
         public abstract bool IsDnsEligible { get; }
 
         /// <summary>
         /// Gets a bool value that indicates whether the Internet Protocol (IP) address is transient.
         /// </summary>
+        [SupportedOSPlatform("windows")]
         public abstract bool IsTransient { get; }
     }
 }
index 1371a47..1a78c1d 100644 (file)
@@ -106,6 +106,10 @@ namespace System.Net.NetworkInformation
         /// </summary>
         public abstract IPGlobalStatistics GetIPv4GlobalStatistics();
 
+        [UnsupportedOSPlatform("osx")]
+        [UnsupportedOSPlatform("ios")]
+        [UnsupportedOSPlatform("tvos")]
+        [UnsupportedOSPlatform("freebsd")]
         public abstract IPGlobalStatistics GetIPv6GlobalStatistics();
 
         public virtual UnicastIPAddressInformationCollection GetUnicastAddresses()
index 863737c..33aa2ae 100644 (file)
@@ -15,6 +15,10 @@ namespace System.Net.NetworkInformation
         /// Gets a bool value that indicates whether this interface is configured to send name resolution queries to a Domain Name System (DNS) server.
         /// </summary>
         [UnsupportedOSPlatform("android")]
+        [UnsupportedOSPlatform("osx")]
+        [UnsupportedOSPlatform("ios")]
+        [UnsupportedOSPlatform("tvos")]
+        [UnsupportedOSPlatform("freebsd")]
         public abstract bool IsDnsEnabled { get; }
 
         /// <summary>
@@ -26,7 +30,7 @@ namespace System.Net.NetworkInformation
         /// <summary>
         /// Gets a bool value that indicates whether this interface is configured to automatically register its IP address information with the Domain Name System (DNS).
         /// </summary>
-        [UnsupportedOSPlatform("android")]
+        [SupportedOSPlatform("windows")]
         public abstract bool IsDynamicDnsEnabled { get; }
 
         /// <summary>
@@ -42,7 +46,7 @@ namespace System.Net.NetworkInformation
         /// <summary>
         /// The address identifies multiple computers. Packets sent to an anycast address are sent to one of the computers identified by the address.
         /// </summary>
-        [UnsupportedOSPlatform("android")]
+        [SupportedOSPlatform("windows")]
         public abstract IPAddressInformationCollection AnycastAddresses { get; }
 
         /// <summary>
@@ -61,12 +65,20 @@ namespace System.Net.NetworkInformation
         /// Gets the addresses for Dynamic Host Configuration Protocol (DHCP) servers.
         /// </summary>
         [UnsupportedOSPlatform("android")]
+        [UnsupportedOSPlatform("osx")]
+        [UnsupportedOSPlatform("ios")]
+        [UnsupportedOSPlatform("tvos")]
+        [UnsupportedOSPlatform("freebsd")]
         public abstract IPAddressCollection DhcpServerAddresses { get; }
 
         /// <summary>
         /// Gets the list of Wins Servers registered with this interface
         /// </summary>
         [UnsupportedOSPlatform("android")]
+        [UnsupportedOSPlatform("osx")]
+        [UnsupportedOSPlatform("ios")]
+        [UnsupportedOSPlatform("tvos")]
+        [UnsupportedOSPlatform("freebsd")]
         public abstract IPAddressCollection WinsServersAddresses { get; }
 
         /// <summary>
index 4570a7b..85e5ef2 100644 (file)
@@ -34,6 +34,7 @@ namespace System.Net.NetworkInformation
         /// <summary>
         /// Gets the number of incoming packets with an unknown protocol.
         /// </summary>
+        [UnsupportedOSPlatform("linux")]
         public abstract long IncomingUnknownProtocolPackets { get; }
 
         /// <summary>
@@ -44,6 +45,7 @@ namespace System.Net.NetworkInformation
         /// <summary>
         /// Gets the number of non-unicast packets sent on the interface.
         /// </summary>
+        [UnsupportedOSPlatform("linux")]
         public abstract long NonUnicastPacketsSent { get; }
 
         /// <summary>
index 9f9d0b1..687902f 100644 (file)
@@ -13,25 +13,26 @@ namespace System.Net.NetworkInformation
         /// <summary>
         /// Gets a bool value that indicates whether an interface uses Windows Internet Name Service (WINS).
         /// </summary>
-        [UnsupportedOSPlatform("android")]
+        [SupportedOSPlatform("windows")]
+        [SupportedOSPlatform("linux")]
         public abstract bool UsesWins { get; }
 
         /// <summary>
         /// Gets a bool value that indicates whether the interface is configured to use a dynamic host configuration protocol (DHCP) server to obtain an IP address.
         /// </summary>
-        [UnsupportedOSPlatform("android")]
+        [SupportedOSPlatform("windows")]
         public abstract bool IsDhcpEnabled { get; }
 
         /// <summary>
         /// Gets a bool value that indicates whether this interface has an automatic private IP addressing (APIPA) address.
         /// </summary>
-        [UnsupportedOSPlatform("android")]
+        [SupportedOSPlatform("windows")]
         public abstract bool IsAutomaticPrivateAddressingActive { get; }
 
         /// <summary>
         /// Gets a bool value that indicates whether this interface has automatic private IP addressing (APIPA) enabled.
         /// </summary>
-        [UnsupportedOSPlatform("android")]
+        [SupportedOSPlatform("windows")]
         public abstract bool IsAutomaticPrivateAddressingEnabled { get; }
 
         /// <summary>
@@ -42,7 +43,8 @@ namespace System.Net.NetworkInformation
         /// <summary>
         /// Gets a bool value that indicates whether this interface can route packets.
         /// </summary>
-        [UnsupportedOSPlatform("android")]
+        [SupportedOSPlatform("windows")]
+        [SupportedOSPlatform("linux")]
         public abstract bool IsForwardingEnabled { get; }
 
         /// <summary>
index 534ac51..1e64760 100644 (file)
@@ -1,6 +1,8 @@
 // Licensed to the .NET Foundation under one or more agreements.
 // The .NET Foundation licenses this file to you under the MIT license.
 
+using System.Runtime.Versioning;
+
 namespace System.Net.NetworkInformation
 {
     /// <summary>
@@ -23,6 +25,10 @@ namespace System.Net.NetworkInformation
         /// </summary>
         /// <param name="scopeLevel">The scope level.</param>
         /// <returns>The IPv6 scope identifier.</returns>
+        [UnsupportedOSPlatform("osx")]
+        [UnsupportedOSPlatform("ios")]
+        [UnsupportedOSPlatform("tvos")]
+        [UnsupportedOSPlatform("freebsd")]
         public virtual long GetScopeId(ScopeLevel scopeLevel)
         {
             throw NotImplemented.ByDesignWithMessage(SR.net_MethodNotImplementedException);
index 2d677ef..482db58 100644 (file)
@@ -1,6 +1,8 @@
 // Licensed to the .NET Foundation under one or more agreements.
 // The .NET Foundation licenses this file to you under the MIT license.
 
+using System.Runtime.Versioning;
+
 namespace System.Net.NetworkInformation
 {
     /// <summary>
@@ -61,21 +63,37 @@ namespace System.Net.NetworkInformation
         /// <summary>
         /// Gets the number of Internet Control Message Protocol version 4 (ICMPv4) error messages received.
         /// </summary>
+        [UnsupportedOSPlatform("osx")]
+        [UnsupportedOSPlatform("ios")]
+        [UnsupportedOSPlatform("tvos")]
+        [UnsupportedOSPlatform("freebsd")]
         public abstract long ErrorsReceived { get; }
 
         /// <summary>
         /// Gets the number of Internet Control Message Protocol version 4 (ICMPv4) Echo Request messages sent.
         /// </summary>
+        [UnsupportedOSPlatform("osx")]
+        [UnsupportedOSPlatform("ios")]
+        [UnsupportedOSPlatform("tvos")]
+        [UnsupportedOSPlatform("freebsd")]
         public abstract long ErrorsSent { get; }
 
         /// <summary>
         /// Gets the number of Internet Control Message Protocol messages received.
         /// </summary>
+        [UnsupportedOSPlatform("osx")]
+        [UnsupportedOSPlatform("ios")]
+        [UnsupportedOSPlatform("tvos")]
+        [UnsupportedOSPlatform("freebsd")]
         public abstract long MessagesReceived { get; }
 
         /// <summary>
         /// Gets the number of Internet Control Message Protocol version 4 (ICMPv4) messages sent.
         /// </summary>
+        [UnsupportedOSPlatform("osx")]
+        [UnsupportedOSPlatform("ios")]
+        [UnsupportedOSPlatform("tvos")]
+        [UnsupportedOSPlatform("freebsd")]
         public abstract long MessagesSent { get; }
 
         /// <summary>
index 6f9d3e7..be51f70 100644 (file)
@@ -1,6 +1,8 @@
 // Licensed to the .NET Foundation under one or more agreements.
 // The .NET Foundation licenses this file to you under the MIT license.
 
+using System.Runtime.Versioning;
+
 namespace System.Net.NetworkInformation
 {
     /// <summary>
@@ -41,11 +43,19 @@ namespace System.Net.NetworkInformation
         /// <summary>
         /// Gets the number of Internet Control Message Protocol version 6 (ICMPv6) error messages received.
         /// </summary>
+        [UnsupportedOSPlatform("osx")]
+        [UnsupportedOSPlatform("ios")]
+        [UnsupportedOSPlatform("tvos")]
+        [UnsupportedOSPlatform("freebsd")]
         public abstract long ErrorsReceived { get; }
 
         /// <summary>
         /// Gets the number of Internet Control Message Protocol version 6 (ICMPv6) error messages sent.
         /// </summary>
+        [UnsupportedOSPlatform("osx")]
+        [UnsupportedOSPlatform("ios")]
+        [UnsupportedOSPlatform("tvos")]
+        [UnsupportedOSPlatform("freebsd")]
         public abstract long ErrorsSent { get; }
 
         /// <summary>
@@ -81,11 +91,19 @@ namespace System.Net.NetworkInformation
         /// <summary>
         /// Gets the number of Internet Control Message Protocol version 6 (ICMPv6) messages received.
         /// </summary>
+        [UnsupportedOSPlatform("osx")]
+        [UnsupportedOSPlatform("ios")]
+        [UnsupportedOSPlatform("tvos")]
+        [UnsupportedOSPlatform("freebsd")]
         public abstract long MessagesReceived { get; }
 
         /// <summary>
         /// Gets the number of Internet Control Message Protocol version 6 (ICMPv6) messages sent.
         /// </summary>
+        [UnsupportedOSPlatform("osx")]
+        [UnsupportedOSPlatform("ios")]
+        [UnsupportedOSPlatform("tvos")]
+        [UnsupportedOSPlatform("freebsd")]
         public abstract long MessagesSent { get; }
 
         /// <summary>
index 9dfe8b5..c16aae4 100644 (file)
@@ -1,6 +1,8 @@
 // Licensed to the .NET Foundation under one or more agreements.
 // The .NET Foundation licenses this file to you under the MIT license.
 
+using System.Runtime.Versioning;
+
 namespace System.Net.NetworkInformation
 {
     /// <summary>
@@ -11,31 +13,37 @@ namespace System.Net.NetworkInformation
         /// <summary>
         /// Gets the number of seconds remaining during which this address is the preferred address.
         /// </summary>
+        [SupportedOSPlatform("windows")]
         public abstract long AddressPreferredLifetime { get; }
 
         /// <summary>
         /// Gets the number of seconds remaining during which this address is valid.
         /// </summary>
+        [SupportedOSPlatform("windows")]
         public abstract long AddressValidLifetime { get; }
 
         /// <summary>
         /// Specifies the amount of time remaining on the Dynamic Host Configuration Protocol (DHCP) lease for this IP address.
         /// </summary>
+        [SupportedOSPlatform("windows")]
         public abstract long DhcpLeaseLifetime { get; }
 
         /// <summary>
         /// Gets a value that indicates the state of the duplicate address detection algorithm.
         /// </summary>
+        [SupportedOSPlatform("windows")]
         public abstract DuplicateAddressDetectionState DuplicateAddressDetectionState { get; }
 
         /// <summary>
         /// Gets a value that identifies the source of a unicast IP address prefix.
         /// </summary>
+        [SupportedOSPlatform("windows")]
         public abstract PrefixOrigin PrefixOrigin { get; }
 
         /// <summary>
         /// Gets a value that identifies the source of a unicast IP address suffix.
         /// </summary>
+        [SupportedOSPlatform("windows")]
         public abstract SuffixOrigin SuffixOrigin { get; }
     }
 }
index 13199b9..139dcc4 100644 (file)
@@ -3,6 +3,7 @@
 
 using System.Diagnostics;
 using System.Net.Sockets;
+using System.Runtime.Versioning;
 
 namespace System.Net.NetworkInformation
 {
@@ -14,31 +15,37 @@ namespace System.Net.NetworkInformation
         /// <summary>
         /// Gets the number of seconds remaining during which this address is the preferred address.
         /// </summary>
+        [SupportedOSPlatform("windows")]
         public abstract long AddressPreferredLifetime { get; }
 
         /// <summary>
         /// Gets the number of seconds remaining during which this address is valid.
         /// </summary>
+        [SupportedOSPlatform("windows")]
         public abstract long AddressValidLifetime { get; }
 
         /// <summary>
         /// Specifies the amount of time remaining on the Dynamic Host Configuration Protocol (DHCP) lease for this IP address.
         /// </summary>
+        [SupportedOSPlatform("windows")]
         public abstract long DhcpLeaseLifetime { get; }
 
         /// <summary>
         /// Gets a value that indicates the state of the duplicate address detection algorithm.
         /// </summary>
+        [SupportedOSPlatform("windows")]
         public abstract DuplicateAddressDetectionState DuplicateAddressDetectionState { get; }
 
         /// <summary>
         /// Gets a value that identifies the source of a unicast IP address prefix.
         /// </summary>
+        [SupportedOSPlatform("windows")]
         public abstract PrefixOrigin PrefixOrigin { get; }
 
         /// <summary>
         /// Gets a value that identifies the source of a unicast IP address suffix.
         /// </summary>
+        [SupportedOSPlatform("windows")]
         public abstract SuffixOrigin SuffixOrigin { get; }
 
         public abstract IPAddress IPv4Mask { get; }