[ci] Move setting CFLAGS and MONO_CHECK_MODE into the run-jenkins.sh script
[mono.git] / mcs / class / referencesource / System / net / System / Net / NetworkInformation / IPGlobalProperties.cs
1
2 using System;
3 using System.Net.Sockets;
4 using System.Net;
5 using System.Threading.Tasks;
6 using System.Security.Permissions;
7 using System.Diagnostics.CodeAnalysis;
8
9 namespace System.Net.NetworkInformation
10 {
11
12     public abstract class IPGlobalProperties
13     {
14         public static IPGlobalProperties GetIPGlobalProperties()
15         {
16             (new NetworkInformationPermission(NetworkInformationAccess.Read)).Demand();
17             return new SystemIPGlobalProperties();
18         }
19
20         internal static IPGlobalProperties InternalGetIPGlobalProperties()
21         {
22             return new SystemIPGlobalProperties();
23         }
24
25         /// Gets the Active Udp Listeners on this machine
26         public abstract IPEndPoint[] GetActiveUdpListeners();
27                 
28         /// Gets the Active Tcp Listeners on this machine
29         public abstract IPEndPoint[] GetActiveTcpListeners ();
30
31         /// Gets the Active Udp Listeners on this machine
32         public abstract TcpConnectionInformation[] GetActiveTcpConnections();
33
34         /// Gets the Dynamic Host Configuration Protocol (DHCP) scope name.
35         public abstract string DhcpScopeName {get;}
36
37         /// Gets the domain in which the local computer is registered.
38         
39         public abstract string DomainName {get;}
40
41         /// Gets the host name for the local computer.
42         
43         public abstract string HostName {get;}
44
45         /// Gets a bool value that specifies whether the local computer is acting as a Windows Internet Name Service (WINS) proxy.
46         public abstract bool IsWinsProxy {get;}
47
48         /// Gets the Network Basic Input/Output System (NetBIOS) node type of the local computer.
49         public abstract NetBiosNodeType NodeType{get;}
50         
51
52         public abstract TcpStatistics GetTcpIPv4Statistics();
53
54         public abstract TcpStatistics GetTcpIPv6Statistics();
55
56         /// Provides Internet Control Message Protocol (ICMP) version 4 statistical data for the local computer.
57         /// Provides User Datagram Protocol (UDP) statistical data for the local computer.
58         
59         public abstract UdpStatistics GetUdpIPv4Statistics();
60         public abstract UdpStatistics GetUdpIPv6Statistics();
61         
62         /// Provides Internet Control Message Protocol (ICMP) version 4 statistical data for the local computer.
63         
64         public abstract IcmpV4Statistics GetIcmpV4Statistics();
65
66         /// Provides Internet Control Message Protocol (ICMP) version 6 statistical data for the local computer.
67         
68         public abstract IcmpV6Statistics GetIcmpV6Statistics();    
69
70         /// Provides Internet Protocol (IP) statistical data for the local computer.
71         public abstract IPGlobalStatistics GetIPv4GlobalStatistics();    
72         public abstract IPGlobalStatistics GetIPv6GlobalStatistics();
73
74         /// Returns a list of all unicast IP addresses after ensuring they are all stable
75         public virtual UnicastIPAddressInformationCollection GetUnicastAddresses()
76         {
77             throw ExceptionHelper.MethodNotImplementedException;
78         }
79
80         public virtual IAsyncResult BeginGetUnicastAddresses(AsyncCallback callback, object state)
81         {
82             throw ExceptionHelper.MethodNotImplementedException;
83         }
84
85         public virtual UnicastIPAddressInformationCollection EndGetUnicastAddresses(IAsyncResult asyncResult)
86         {
87             throw ExceptionHelper.MethodNotImplementedException;
88         }
89
90         //************* Task-based async public methods *************************
91         [HostProtection(ExternalThreading = true)]
92         [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Unicast")]
93         public virtual Task<UnicastIPAddressInformationCollection> GetUnicastAddressesAsync()
94         {
95             return Task<UnicastIPAddressInformationCollection>.Factory.FromAsync(BeginGetUnicastAddresses, EndGetUnicastAddresses, null);
96         }
97
98     }    
99 }
100