/
IPGlobalProperties.cs
129 lines (107 loc) · 4.85 KB
/
IPGlobalProperties.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
// 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;
using System.Threading.Tasks;
namespace System.Net.NetworkInformation
{
/// <summary>
/// Provides various global machine properties related to Internet Protocol (IP),
/// such as the local host name, domain name, and active socket connections.
/// </summary>
public abstract class IPGlobalProperties
{
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public static IPGlobalProperties GetIPGlobalProperties()
{
return IPGlobalPropertiesPal.GetIPGlobalProperties();
}
/// <summary>
/// Gets the Active Udp Listeners on this machine.
/// </summary>
[UnsupportedOSPlatform("android")]
public abstract IPEndPoint[] GetActiveUdpListeners();
/// <summary>
/// Gets the Active Tcp Listeners on this machine.
/// </summary>
[UnsupportedOSPlatform("android")]
public abstract IPEndPoint[] GetActiveTcpListeners();
/// <summary>
/// Gets the Active Udp Listeners on this machine.
/// </summary>
[UnsupportedOSPlatform("android")]
public abstract TcpConnectionInformation[] GetActiveTcpConnections();
/// <summary>
/// Gets the Dynamic Host Configuration Protocol (DHCP) scope name.
/// </summary>
[UnsupportedOSPlatform("android")]
public abstract string DhcpScopeName { get; }
/// <summary>
/// Gets the domain in which the local computer is registered.
/// </summary>
public abstract string DomainName { get; }
/// <summary>
/// Gets the host name for the local computer.
/// </summary>
public abstract string HostName { get; }
/// <summary>
/// Gets a bool value that specifies whether the local computer is acting as a Windows Internet Name Service (WINS) proxy.
/// </summary>
[UnsupportedOSPlatform("android")]
public abstract bool IsWinsProxy { get; }
/// <summary>
/// Gets the Network Basic Input/Output System (NetBIOS) node type of the local computer.
/// </summary>
public abstract NetBiosNodeType NodeType { get; }
public virtual IAsyncResult BeginGetUnicastAddresses(AsyncCallback? callback, object? state)
{
throw NotImplemented.ByDesignWithMessage(SR.net_MethodNotImplementedException);
}
public virtual UnicastIPAddressInformationCollection EndGetUnicastAddresses(IAsyncResult asyncResult)
{
throw NotImplemented.ByDesignWithMessage(SR.net_MethodNotImplementedException);
}
[UnsupportedOSPlatform("android")]
public abstract TcpStatistics GetTcpIPv4Statistics();
[UnsupportedOSPlatform("android")]
public abstract TcpStatistics GetTcpIPv6Statistics();
/// <summary>
/// Provides User Datagram Protocol (UDP) statistical data for the local computer.
/// </summary>
[UnsupportedOSPlatform("android")]
public abstract UdpStatistics GetUdpIPv4Statistics();
[UnsupportedOSPlatform("android")]
public abstract UdpStatistics GetUdpIPv6Statistics();
/// <summary>
/// Provides Internet Control Message Protocol (ICMP) version 4 statistical data for the local computer.
/// </summary>
[UnsupportedOSPlatform("android")]
public abstract IcmpV4Statistics GetIcmpV4Statistics();
/// <summary>
/// Provides Internet Control Message Protocol (ICMP) version 6 statistical data for the local computer.
/// </summary>
[UnsupportedOSPlatform("android")]
public abstract IcmpV6Statistics GetIcmpV6Statistics();
/// <summary>
/// Provides Internet Protocol (IP) statistical data for the local computer.
/// </summary>
public abstract IPGlobalStatistics GetIPv4GlobalStatistics();
[UnsupportedOSPlatform("osx")]
[UnsupportedOSPlatform("ios")]
[UnsupportedOSPlatform("tvos")]
[UnsupportedOSPlatform("freebsd")]
public abstract IPGlobalStatistics GetIPv6GlobalStatistics();
public virtual UnicastIPAddressInformationCollection GetUnicastAddresses()
{
throw NotImplemented.ByDesignWithMessage(SR.net_MethodNotImplementedException);
}
/// <summary>
/// Returns a list of all unicast IP addresses after ensuring they are all stable.
/// </summary>
/// <returns>The collection of unicast IP addresses.</returns>
public virtual Task<UnicastIPAddressInformationCollection> GetUnicastAddressesAsync()
{
throw NotImplemented.ByDesignWithMessage(SR.net_MethodNotImplementedException);
}
}
}