/
NetworkInterface.cs
130 lines (112 loc) · 5.21 KB
/
NetworkInterface.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
130
// 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
{
public abstract class NetworkInterface
{
/// <summary>
/// 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")]
public static NetworkInterface[] GetAllNetworkInterfaces()
{
return NetworkInterfacePal.GetAllNetworkInterfaces();
}
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public static bool GetIsNetworkAvailable()
{
return NetworkInterfacePal.GetIsNetworkAvailable();
}
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public static int IPv6LoopbackInterfaceIndex
{
get
{
return NetworkInterfacePal.IPv6LoopbackInterfaceIndex;
}
}
[UnsupportedOSPlatform("illumos")]
[UnsupportedOSPlatform("solaris")]
public static int LoopbackInterfaceIndex
{
get
{
return NetworkInterfacePal.LoopbackInterfaceIndex;
}
}
public virtual string Id { get { throw NotImplemented.ByDesignWithMessage(SR.net_PropertyNotImplementedException); } }
/// <summary>
/// Gets the name of the network interface.
/// </summary>
public virtual string Name { get { throw NotImplemented.ByDesignWithMessage(SR.net_PropertyNotImplementedException); } }
/// <summary>
/// Gets the description of the network interface
/// </summary>
public virtual string Description { get { throw NotImplemented.ByDesignWithMessage(SR.net_PropertyNotImplementedException); } }
/// <summary>
/// Gets the IP properties for this network interface.
/// </summary>
/// <returns>The interface's IP properties.</returns>
public virtual IPInterfaceProperties GetIPProperties()
{
throw NotImplemented.ByDesignWithMessage(SR.net_MethodNotImplementedException);
}
/// <summary>
/// Provides Internet Protocol (IP) statistical data for this network interface.
/// </summary>
/// <returns>The interface's IP statistics.</returns>
[UnsupportedOSPlatform("android")]
public virtual IPInterfaceStatistics GetIPStatistics()
{
throw NotImplemented.ByDesignWithMessage(SR.net_MethodNotImplementedException);
}
/// <summary>
/// Provides Internet Protocol (IP) statistical data for this network interface.
/// Despite the naming, the results are not IPv4 specific.
/// Do not use this method, use GetIPStatistics instead.
/// </summary>
/// <returns>The interface's IP statistics.</returns>
[UnsupportedOSPlatform("android")]
public virtual IPv4InterfaceStatistics GetIPv4Statistics()
{
throw NotImplemented.ByDesignWithMessage(SR.net_MethodNotImplementedException);
}
/// <summary>
/// Gets the current operational state of the network connection.
/// </summary>
public virtual OperationalStatus OperationalStatus { get { throw NotImplemented.ByDesignWithMessage(SR.net_PropertyNotImplementedException); } }
/// <summary>
/// Gets the speed of the interface in bits per second as reported by the interface.
/// </summary>
public virtual long Speed { get { throw NotImplemented.ByDesignWithMessage(SR.net_PropertyNotImplementedException); } }
/// <summary>
/// Gets a bool value that indicates whether the network interface is set to only receive data packets.
/// </summary>
public virtual bool IsReceiveOnly { get { throw NotImplemented.ByDesignWithMessage(SR.net_PropertyNotImplementedException); } }
/// <summary>
/// Gets a bool value that indicates whether this network interface is enabled to receive multicast packets.
/// </summary>
public virtual bool SupportsMulticast { get { throw NotImplemented.ByDesignWithMessage(SR.net_PropertyNotImplementedException); } }
/// <summary>
/// Gets the physical address of this network interface
/// </summary>
/// <returns>The interface's physical address.</returns>
public virtual PhysicalAddress GetPhysicalAddress()
{
throw NotImplemented.ByDesignWithMessage(SR.net_MethodNotImplementedException);
}
/// <summary>
/// Gets the interface type.
/// </summary>
public virtual NetworkInterfaceType NetworkInterfaceType { get { throw NotImplemented.ByDesignWithMessage(SR.net_PropertyNotImplementedException); } }
public virtual bool Supports(NetworkInterfaceComponent networkInterfaceComponent)
{
throw NotImplemented.ByDesignWithMessage(SR.net_MethodNotImplementedException);
}
}
}