Skip to content

Commit 23addbb

Browse files
committed
Haiku: Mark unsupported advanced network functions
Add the `UnsupportedOSPlatformAttribute` for Haiku to managed network functions in `System.Net.NetworkInformation` to provide a consistent API on Haiku.
1 parent c582fa2 commit 23addbb

13 files changed

+45
-0
lines changed

src/libraries/System.Net.NetworkInformation/ref/System.Net.NetworkInformation.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ protected IPGlobalProperties() { }
178178
public abstract System.Net.NetworkInformation.IcmpV6Statistics GetIcmpV6Statistics();
179179
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("illumos")]
180180
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("solaris")]
181+
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("haiku")]
181182
public static System.Net.NetworkInformation.IPGlobalProperties GetIPGlobalProperties() { throw null; }
182183
public abstract System.Net.NetworkInformation.IPGlobalStatistics GetIPv4GlobalStatistics();
183184
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("freebsd")]
@@ -401,9 +402,11 @@ public partial class NetworkChange
401402
public NetworkChange() { }
402403
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("illumos")]
403404
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("solaris")]
405+
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("haiku")]
404406
public static event System.Net.NetworkInformation.NetworkAddressChangedEventHandler? NetworkAddressChanged { add { } remove { } }
405407
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("illumos")]
406408
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("solaris")]
409+
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("haiku")]
407410
public static event System.Net.NetworkInformation.NetworkAvailabilityChangedEventHandler? NetworkAvailabilityChanged { add { } remove { } }
408411
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
409412
[System.ObsoleteAttribute("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", true)]
@@ -425,10 +428,12 @@ protected NetworkInterface() { }
425428
public virtual string Id { get { throw null; } }
426429
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("illumos")]
427430
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("solaris")]
431+
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("haiku")]
428432
public static int IPv6LoopbackInterfaceIndex { get { throw null; } }
429433
public virtual bool IsReceiveOnly { get { throw null; } }
430434
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("illumos")]
431435
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("solaris")]
436+
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("haiku")]
432437
public static int LoopbackInterfaceIndex { get { throw null; } }
433438
public virtual string Name { get { throw null; } }
434439
public virtual System.Net.NetworkInformation.NetworkInterfaceType NetworkInterfaceType { get { throw null; } }
@@ -437,6 +442,7 @@ protected NetworkInterface() { }
437442
public virtual bool SupportsMulticast { get { throw null; } }
438443
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("illumos")]
439444
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("solaris")]
445+
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("haiku")]
440446
public static System.Net.NetworkInformation.NetworkInterface[] GetAllNetworkInterfaces() { throw null; }
441447
public virtual System.Net.NetworkInformation.IPInterfaceProperties GetIPProperties() { throw null; }
442448
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
@@ -445,6 +451,7 @@ protected NetworkInterface() { }
445451
public virtual System.Net.NetworkInformation.IPv4InterfaceStatistics GetIPv4Statistics() { throw null; }
446452
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("illumos")]
447453
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("solaris")]
454+
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("haiku")]
448455
public static bool GetIsNetworkAvailable() { throw null; }
449456
public virtual System.Net.NetworkInformation.PhysicalAddress GetPhysicalAddress() { throw null; }
450457
public virtual bool Supports(System.Net.NetworkInformation.NetworkInterfaceComponent networkInterfaceComponent) { throw null; }

src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/IPGlobalProperties.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public abstract class IPGlobalProperties
1414
{
1515
[UnsupportedOSPlatform("illumos")]
1616
[UnsupportedOSPlatform("solaris")]
17+
[UnsupportedOSPlatform("haiku")]
1718
public static IPGlobalProperties GetIPGlobalProperties()
1819
{
1920
return IPGlobalPropertiesPal.GetIPGlobalProperties();

src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/IPGlobalPropertiesPal.UnknownUnix.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ internal static class IPGlobalPropertiesPal
99
{
1010
[UnsupportedOSPlatform("illumos")]
1111
[UnsupportedOSPlatform("solaris")]
12+
[UnsupportedOSPlatform("haiku")]
1213
public static IPGlobalProperties GetIPGlobalProperties()
1314
{
1415
throw new PlatformNotSupportedException();

src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/NetworkAddressChange.Android.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public partial class NetworkChange
2020

2121
[UnsupportedOSPlatform("illumos")]
2222
[UnsupportedOSPlatform("solaris")]
23+
[UnsupportedOSPlatform("haiku")]
2324
public static event NetworkAddressChangedEventHandler? NetworkAddressChanged
2425
{
2526
add
@@ -63,6 +64,7 @@ public static event NetworkAddressChangedEventHandler? NetworkAddressChanged
6364

6465
[UnsupportedOSPlatform("illumos")]
6566
[UnsupportedOSPlatform("solaris")]
67+
[UnsupportedOSPlatform("haiku")]
6668
public static event NetworkAvailabilityChangedEventHandler? NetworkAvailabilityChanged
6769
{
6870
add

src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/NetworkAddressChange.OSX.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public partial class NetworkChange
4040

4141
[UnsupportedOSPlatform("illumos")]
4242
[UnsupportedOSPlatform("solaris")]
43+
[UnsupportedOSPlatform("haiku")]
4344
public static event NetworkAddressChangedEventHandler? NetworkAddressChanged
4445
{
4546
add
@@ -79,6 +80,7 @@ public static event NetworkAddressChangedEventHandler? NetworkAddressChanged
7980

8081
[UnsupportedOSPlatform("illumos")]
8182
[UnsupportedOSPlatform("solaris")]
83+
[UnsupportedOSPlatform("haiku")]
8284
public static event NetworkAvailabilityChangedEventHandler? NetworkAvailabilityChanged
8385
{
8486
add

src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/NetworkAddressChange.Unix.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ private static Socket? Socket
4646

4747
[UnsupportedOSPlatform("illumos")]
4848
[UnsupportedOSPlatform("solaris")]
49+
[UnsupportedOSPlatform("haiku")]
4950
public static event NetworkAddressChangedEventHandler? NetworkAddressChanged
5051
{
5152
add
@@ -88,6 +89,7 @@ public static event NetworkAddressChangedEventHandler? NetworkAddressChanged
8889

8990
[UnsupportedOSPlatform("illumos")]
9091
[UnsupportedOSPlatform("solaris")]
92+
[UnsupportedOSPlatform("haiku")]
9193
public static event NetworkAvailabilityChangedEventHandler? NetworkAvailabilityChanged
9294
{
9395
add

src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/NetworkAddressChange.UnknownUnix.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public NetworkChange()
1818

1919
[UnsupportedOSPlatform("illumos")]
2020
[UnsupportedOSPlatform("solaris")]
21+
[UnsupportedOSPlatform("haiku")]
2122
public static event NetworkAddressChangedEventHandler? NetworkAddressChanged
2223
{
2324
add { throw new PlatformNotSupportedException(); }
@@ -26,6 +27,7 @@ public static event NetworkAddressChangedEventHandler? NetworkAddressChanged
2627

2728
[UnsupportedOSPlatform("illumos")]
2829
[UnsupportedOSPlatform("solaris")]
30+
[UnsupportedOSPlatform("haiku")]
2931
public static event NetworkAvailabilityChangedEventHandler? NetworkAvailabilityChanged
3032
{
3133
add { throw new PlatformNotSupportedException(); }

src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/NetworkAddressChange.Windows.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public partial class NetworkChange
1515

1616
[UnsupportedOSPlatform("illumos")]
1717
[UnsupportedOSPlatform("solaris")]
18+
[UnsupportedOSPlatform("haiku")]
1819
public static event NetworkAvailabilityChangedEventHandler? NetworkAvailabilityChanged
1920
{
2021
add
@@ -29,6 +30,7 @@ public static event NetworkAvailabilityChangedEventHandler? NetworkAvailabilityC
2930

3031
[UnsupportedOSPlatform("illumos")]
3132
[UnsupportedOSPlatform("solaris")]
33+
[UnsupportedOSPlatform("haiku")]
3234
public static event NetworkAddressChangedEventHandler? NetworkAddressChanged
3335
{
3436
add

src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/NetworkInterface.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,23 @@ public abstract class NetworkInterface
1313
/// <returns>An array of all network interfaces on the local computer.</returns>
1414
[UnsupportedOSPlatform("illumos")]
1515
[UnsupportedOSPlatform("solaris")]
16+
[UnsupportedOSPlatform("haiku")]
1617
public static NetworkInterface[] GetAllNetworkInterfaces()
1718
{
1819
return NetworkInterfacePal.GetAllNetworkInterfaces();
1920
}
2021

2122
[UnsupportedOSPlatform("illumos")]
2223
[UnsupportedOSPlatform("solaris")]
24+
[UnsupportedOSPlatform("haiku")]
2325
public static bool GetIsNetworkAvailable()
2426
{
2527
return NetworkInterfacePal.GetIsNetworkAvailable();
2628
}
2729

2830
[UnsupportedOSPlatform("illumos")]
2931
[UnsupportedOSPlatform("solaris")]
32+
[UnsupportedOSPlatform("haiku")]
3033
public static int IPv6LoopbackInterfaceIndex
3134
{
3235
get
@@ -37,6 +40,7 @@ public static int IPv6LoopbackInterfaceIndex
3740

3841
[UnsupportedOSPlatform("illumos")]
3942
[UnsupportedOSPlatform("solaris")]
43+
[UnsupportedOSPlatform("haiku")]
4044
public static int LoopbackInterfaceIndex
4145
{
4246
get

src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/NetworkInterfacePal.UnknownUnix.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,31 @@ internal static class NetworkInterfacePal
1010
/// Returns objects that describe the network interfaces on the local computer.
1111
[UnsupportedOSPlatform("illumos")]
1212
[UnsupportedOSPlatform("solaris")]
13+
[UnsupportedOSPlatform("haiku")]
1314
public static NetworkInterface[] GetAllNetworkInterfaces()
1415
{
1516
throw new PlatformNotSupportedException();
1617
}
1718

1819
[UnsupportedOSPlatform("illumos")]
1920
[UnsupportedOSPlatform("solaris")]
21+
[UnsupportedOSPlatform("haiku")]
2022
public static bool GetIsNetworkAvailable()
2123
{
2224
throw new PlatformNotSupportedException();
2325
}
2426

2527
[UnsupportedOSPlatform("illumos")]
2628
[UnsupportedOSPlatform("solaris")]
29+
[UnsupportedOSPlatform("haiku")]
2730
public static int IPv6LoopbackInterfaceIndex
2831
{
2932
get { throw new PlatformNotSupportedException(); }
3033
}
3134

3235
[UnsupportedOSPlatform("illumos")]
3336
[UnsupportedOSPlatform("solaris")]
37+
[UnsupportedOSPlatform("haiku")]
3438
public static int LoopbackInterfaceIndex
3539
{
3640
get { throw new PlatformNotSupportedException(); }

0 commit comments

Comments
 (0)