Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,22 @@
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.NetworkChange.cs" Link="Common\Interop\Unix\System.Native\Interop.NetworkChange.cs" />
</ItemGroup>

<!-- SunOS (Solaris, illumos) -->
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'illumos' or '$(TargetPlatformIdentifier)' == 'solaris'">
<Compile Include="System\Net\NetworkInformation\IPGlobalPropertiesPal.SunOS.cs" />
<Compile Include="System\Net\NetworkInformation\NetworkInterfacePal.SunOS.cs" />
<Compile Include="System\Net\NetworkInformation\SunOSIPGlobalProperties.cs" />
<Compile Include="System\Net\NetworkInformation\SunOSIPGlobalStatistics.cs" />
<Compile Include="System\Net\NetworkInformation\SunOSIPInterfaceProperties.cs" />
<Compile Include="System\Net\NetworkInformation\SunOSIPv4InterfaceProperties.cs" />
<Compile Include="System\Net\NetworkInformation\SunOSIPv6InterfaceProperties.cs" />
<Compile Include="System\Net\NetworkInformation\SunOSNetworkInterface.cs" />
<Compile Include="System\Net\NetworkInformation\NetworkAddressChange.UnknownUnix.cs" />
<!-- Could port NetworkAddressChange.Android.cs using a PF_ROUTE socket -->
</ItemGroup>

<!-- Unknown Unix -->
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'illumos' or '$(TargetPlatformIdentifier)' == 'solaris' or '$(TargetPlatformIdentifier)' == 'haiku'">
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'haiku'">
<Compile Include="System\Net\NetworkInformation\IPGlobalPropertiesPal.UnknownUnix.cs" />
<Compile Include="System\Net\NetworkInformation\NetworkInterfacePal.UnknownUnix.cs" />
<Compile Include="System\Net\NetworkInformation\NetworkAddressChange.UnknownUnix.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ namespace System.Net.NetworkInformation
/// </summary>
public abstract class IPGlobalProperties
{
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
[UnsupportedOSPlatform("haiku")]
public static IPGlobalProperties GetIPGlobalProperties()
{
Expand All @@ -24,24 +22,32 @@ public static IPGlobalProperties GetIPGlobalProperties()
/// Gets the Active Udp Listeners on this machine.
/// </summary>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract IPEndPoint[] GetActiveUdpListeners();

/// <summary>
/// Gets the Active Tcp Listeners on this machine.
/// </summary>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract IPEndPoint[] GetActiveTcpListeners();

/// <summary>
/// Gets the Active Udp Listeners on this machine.
/// </summary>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract TcpConnectionInformation[] GetActiveTcpConnections();

/// <summary>
/// Gets the Dynamic Host Configuration Protocol (DHCP) scope name.
/// </summary>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract string DhcpScopeName { get; }

/// <summary>
Expand All @@ -58,6 +64,8 @@ public static IPGlobalProperties GetIPGlobalProperties()
/// Gets a bool value that specifies whether the local computer is acting as a Windows Internet Name Service (WINS) proxy.
/// </summary>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract bool IsWinsProxy { get; }

/// <summary>
Expand All @@ -76,30 +84,42 @@ public virtual UnicastIPAddressInformationCollection EndGetUnicastAddresses(IAsy
}

[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract TcpStatistics GetTcpIPv4Statistics();

[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract TcpStatistics GetTcpIPv6Statistics();

/// <summary>
/// Provides User Datagram Protocol (UDP) statistical data for the local computer.
/// </summary>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract UdpStatistics GetUdpIPv4Statistics();

[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract UdpStatistics GetUdpIPv6Statistics();

/// <summary>
/// Provides Internet Control Message Protocol (ICMP) version 4 statistical data for the local computer.
/// </summary>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract IcmpV4Statistics GetIcmpV4Statistics();

/// <summary>
/// Provides Internet Control Message Protocol (ICMP) version 6 statistical data for the local computer.
/// </summary>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract IcmpV6Statistics GetIcmpV6Statistics();

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace System.Net.NetworkInformation
{
internal static class IPGlobalPropertiesPal
{
public static IPGlobalProperties GetIPGlobalProperties()
{
return new SunOSIPGlobalProperties();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@ public abstract class IPGlobalStatistics
/// Gets the default time-to-live (TTL) value for Internet Protocol (IP) packets.
/// </summary>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract int DefaultTtl { get; }

/// <summary>
/// Gets a bool value that specifies whether Internet Protocol (IP) packet forwarding is enabled.
/// </summary>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract bool ForwardingEnabled { get; }

/// <summary>
Expand All @@ -36,108 +40,144 @@ public abstract class IPGlobalStatistics
/// Gets the number of outbound Internet Protocol (IP) packets.
/// </summary>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract long OutputPacketRequests { get; }

/// <summary>
/// Gets the number of routes in the routing table that have been discarded.
/// </summary>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract long OutputPacketRoutingDiscards { get; }

/// <summary>
/// Gets the number of transmitted Internet Protocol (IP) packets that have been discarded.
/// </summary>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract long OutputPacketsDiscarded { get; }

/// <summary>
/// Gets the number of Internet Protocol (IP) packets for which the local computer could not determine a route to the destination address.
/// </summary>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract long OutputPacketsWithNoRoute { get; }

/// <summary>
/// Gets the number of Internet Protocol (IP) packets that could not be fragmented.
/// </summary>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract long PacketFragmentFailures { get; }

/// <summary>
/// Gets the number of Internet Protocol (IP) packets that required reassembly.
/// </summary>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract long PacketReassembliesRequired { get; }

/// <summary>
/// Gets the number of Internet Protocol (IP) packets that were not successfully reassembled.
/// </summary>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract long PacketReassemblyFailures { get; }

/// <summary>
/// Gets the maximum amount of time within which all fragments of an Internet Protocol (IP) packet must arrive.
/// </summary>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract long PacketReassemblyTimeout { get; }

/// <summary>
/// Gets the number of Internet Protocol (IP) packets fragmented.
/// </summary>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract long PacketsFragmented { get; }

/// <summary>
/// Gets the number of Internet Protocol (IP) packets reassembled.
/// </summary>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract long PacketsReassembled { get; }

/// <summary>
/// Gets the number of Internet Protocol (IP) packets received.
/// </summary>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract long ReceivedPackets { get; }

/// <summary>
/// Gets the number of Internet Protocol(IP) packets received and delivered.
/// </summary>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract long ReceivedPacketsDelivered { get; }

/// <summary>
/// Gets the number of Internet Protocol (IP) packets that have been received and discarded.
/// </summary>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract long ReceivedPacketsDiscarded { get; }

/// <summary>
/// Gets the number of Internet Protocol (IP) packets forwarded.
/// </summary>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract long ReceivedPacketsForwarded { get; }

/// <summary>
/// Gets the number of Internet Protocol (IP) packets with address errors that were received.
/// </summary>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract long ReceivedPacketsWithAddressErrors { get; }

/// <summary>
/// Gets the number of Internet Protocol (IP) packets with header errors that were received.
/// </summary>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract long ReceivedPacketsWithHeadersErrors { get; }

/// <summary>
/// Gets the number of Internet Protocol (IP) packets received on the local machine with an unknown protocol in the header.
/// </summary>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract long ReceivedPacketsWithUnknownProtocol { get; }

/// <summary>
/// Gets the number of routes in the Internet Protocol (IP) routing table.
/// </summary>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract int NumberOfRoutes { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@ public abstract class IPInterfaceProperties
[UnsupportedOSPlatform("ios")]
[UnsupportedOSPlatform("tvos")]
[UnsupportedOSPlatform("freebsd")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract bool IsDnsEnabled { get; }

/// <summary>
/// Gets the Domain Name System (DNS) suffix associated with this interface.
/// </summary>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract string DnsSuffix { get; }

/// <summary>
Expand Down Expand Up @@ -53,12 +57,16 @@ public abstract class IPInterfaceProperties
/// The address is that of a Domain Name Service (DNS) server for the local computer.
/// </summary>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract IPAddressCollection DnsAddresses { get; }

/// <summary>
/// Gets the network gateway addresses.
/// </summary>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract GatewayIPAddressInformationCollection GatewayAddresses { get; }

/// <summary>
Expand All @@ -69,6 +77,8 @@ public abstract class IPInterfaceProperties
[UnsupportedOSPlatform("ios")]
[UnsupportedOSPlatform("tvos")]
[UnsupportedOSPlatform("freebsd")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract IPAddressCollection DhcpServerAddresses { get; }

/// <summary>
Expand All @@ -79,6 +89,8 @@ public abstract class IPInterfaceProperties
[UnsupportedOSPlatform("ios")]
[UnsupportedOSPlatform("tvos")]
[UnsupportedOSPlatform("freebsd")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public abstract IPAddressCollection WinsServersAddresses { get; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,18 @@ public abstract class NetworkInterface
/// Returns objects that describe the network interfaces on the local computer.
/// </summary>
/// <returns>An array of all network interfaces on the local computer.</returns>
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
[UnsupportedOSPlatform("haiku")]
public static NetworkInterface[] GetAllNetworkInterfaces()
{
return NetworkInterfacePal.GetAllNetworkInterfaces();
}

[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
[UnsupportedOSPlatform("haiku")]
public static bool GetIsNetworkAvailable()
{
return NetworkInterfacePal.GetIsNetworkAvailable();
}

[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
[UnsupportedOSPlatform("haiku")]
public static int IPv6LoopbackInterfaceIndex
{
Expand All @@ -38,8 +32,6 @@ public static int IPv6LoopbackInterfaceIndex
}
}

[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
[UnsupportedOSPlatform("haiku")]
public static int LoopbackInterfaceIndex
{
Expand Down Expand Up @@ -75,6 +67,8 @@ public virtual IPInterfaceProperties GetIPProperties()
/// </summary>
/// <returns>The interface's IP statistics.</returns>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public virtual IPInterfaceStatistics GetIPStatistics()
{
throw NotImplemented.ByDesignWithMessage(SR.net_MethodNotImplementedException);
Expand All @@ -87,6 +81,8 @@ public virtual IPInterfaceStatistics GetIPStatistics()
/// </summary>
/// <returns>The interface's IP statistics.</returns>
[UnsupportedOSPlatform("android")]
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public virtual IPv4InterfaceStatistics GetIPv4Statistics()
{
throw NotImplemented.ByDesignWithMessage(SR.net_MethodNotImplementedException);
Expand Down
Loading
Loading